Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created November 22, 2020 03:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/9efa018280d9bf614faf099906b4b4b6 to your computer and use it in GitHub Desktop.
Save parzibyte/9efa018280d9bf614faf099906b4b4b6 to your computer and use it in GitHub Desktop.
select employee_id,
sum(case when status = 'presence' then 1 else 0 end) as presence_count,
sum(case when status = 'absence' then 1 else 0 end) as absence_count
from employee_attendance
group by employee_id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment