Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT titles.title,
- count(*) AS total,
- sum(case when employees.gender = 'M' then 1 else 0 end) AS male,
- sum(case when employees.gender = 'F' then 1 else 0 end) AS female
- FROM employees INNER JOIN titles ON employees.emp_no=titles.emp_no
- GROUP BY titles.title;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement