I modified the question. Now a sample table is included and an expected result list. I also added a piece of the sql to obtain the results.The remaining question is how to calculate the total break time in minutes. The first two columns of the results are already in the code.Can anyone please help me?Thanks in advance Sample of table clockemployee check_in check_out----------- ---------------- ----------------1 08:00:00.0000000 11:00:00.00000002 08:30:00.0000000 12:14:00.00000002 12:25:00.0000000 16:00:00.00000001 11:30:00.0000000 14:00:00.0000000sample of table breaktstartt endt---------------- ----------------09:45:00.0000000 10:00:00.000000012:00:00.0000000 12:30:00.0000000The result I am searching for:| Employee | Timemin| Breakmin|+----------+--------+---------+| 1 | 180 | 15 || 2 | 224 | 19 || 2 | 215 | 5 || 1 | 150 | 30 |+----------+--------+---------+DROP TABLE breakt;CREATE TABLE breakt( startt TIME, endt TIME );INSERT INTO breakt(startt,endt) VALUES ('09:45:00','10:00:00');INSERT INTO breakt(startt,endt) VALUES ('12:00:00','12:30:00');select * from breaktDROP TABLE clock;CREATE TABLE clock( employee integer , check_in TIME , check_out TIME );INSERT INTO clock(employee,check_in,check_out) VALUES (1,'08:00:00','11:00:00');INSERT INTO clock(employee,check_in,check_out) VALUES (2,'08:30:00','12:14:00');INSERT INTO clock(employee,check_in,check_out) VALUES (2,'12:25:00','16:00:00');INSERT INTO clock(employee,check_in,check_out) VALUES (1,'11:30:00','14:00:00');select * from clockselect employee,DATEDIFF(MINUTE,check_in,check_out) as timeminfrom clock