SELECT
id,
employee_number,
date(ra.time_in_out) as as_of_date,
(SELECT
time_in_out
FROM raw_attendance rmax
WHERE (rmax.time_in_out)= (ra.time_in_out)
ORDER BY time_in_out DESC LIMIT 1) AS max_time,
(SELECT
time_in_out
FROM raw_attendance rmin
WHERE (rmin.time_in_out)=(ra.time_in_out)
ORDER BY time_in_out ASC LIMIT 1) AS min_time
FROM raw_attendance ra
GROUP BY date(ra.time_in_out)
1条答案
按热度按时间xpcnnkqh1#