How to Have Multiple Counts in Redshift

To do multiple counts in one query in Redshift, you can combine COUNT() with CASE:

  count(1), -- count all users
  count(case when gender = 'male' then 1 else 0 end), -- count male users
  count(case when beta = true then 1 else 0 end) -- count beta users
  count(case when beta = false then 1 else 0 end) -- count active non-beta users
from users;
Finally, a unified workspace for your SQL development
Get more done, together, with PopSQL and Redshift