[Solved] Find out the Employees who were absent for 3 consecutive days [closed]

[ad_1]

SELECT DISTINCT A.EMPLOYEENAME
FROM Attendance AS A
JOIN Attendance AS B ON B.LEAVE_DATE = A.LEAVE_DATE + 1 AND B.EMPLOYEENAME = A.EMPLOYEENAME
JOIN Attendance AS C ON C.LEAVE_DATE = B.LEAVE_DATE + 1 AND C.EMPLOYEENAME = B.EMPLOYEENAME

The inner joins will remove all employee who were not absent three consecutive days.

14

[ad_2]

solved Find out the Employees who were absent for 3 consecutive days [closed]