力扣leetcode 第2394题 求工作时间不达标的员工
select employee_id from ( select DISTINCT e.employee_id, e.needed_hours * 60 as needed_hours, ifnull((select sum(timestampdiff(minute, DATE_FORMAT(l.in_time, '%Y-%m-%d %H:%i:00'), DATE_FORMAT(DATE_ADD(l.out_time, interval (59 - SECOND(l.in_time)) SECOND), '%Y-%m-%d %H:%i:00'))) from Logs l where l.employee_id = e.employee_id), 0) as total from Employees e ) t where total < needed_hours;
标签:-%,needed,id,力扣,DATE,2394,employee,leetcode,select From: https://www.cnblogs.com/muphy/p/16808489.html