How to count rows in one column separately for each type of rows in other column using SQL

  • 23 October 2021
  • 0 replies


I need to count a number of rows in one column that respond to one from two types of rows in other column while also aliasing them

the goal is to create a table with number of users of each app.

app1 users ***

app2 users ***


select count(users) where app = 'app1' as app1_users, count (users) where app = 'app2' as app2 users
  from table


should i use inner join for this? 

I’m just starting and it seems an easy task but i’m stuck, please push me in the right direction


This topic has been closed for comments