1892. Find Total Time Spent by Each Employee
My accepted SQL solution to LeetCode problem 1892, Find Total Time Spent by Each Employee, running in 477ms.
- Difficulty: Easy
- SQL
- Runtime 477ms
- Memory 0.0B
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
SQL
Accepted on LeetCode — runtime 477ms, memory 0.0B, accepted 2025-12-31.
SELECT event_day AS day, emp_id,
SUM(out_time - in_time) AS total_time
FROM Employees
GROUP BY event_day, emp_id