Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select * from (select emp_id,emp_name,profile_picture_url,
- sum(
- case
- when holiday = TRUE then 0
- when offday = TRUE then 0
- when on_leave = TRUE then 0
- else 1
- end
- ) as expected_days,
- sum(
- case
- when late = TRUE then 1
- else 0
- end
- ) as late_days
- from attendance_summary
- where office_id = 40
- and att_date_in_milliseconds between 1561831200000 and 1563472800000
- and present = true
- and include_in_att_report = true
- group by emp_id,emp_name,profile_picture_url
- ) as temp
- order by (Cast(late_days as float)/ Cast(nullif(expected_days,0) as float)) ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement