Based on Bluefeet's accepted response with an added nuance using OVER()
:
SELECT distributor_id,
COUNT(*) total,
SUM(case when level = 'exec' then 1 else 0 end) OVER() ExecCount,
SUM(case when level = 'personal' then 1 else 0 end) OVER () PersonalCount
FROM yourtable
GROUP BY distributor_id
Using OVER()
with nothing in the () will give you the total count for the whole dataset.