using count and group by at the same select statement
- by Stavros
Hello, I have an sql select query that has a group by.
I want to count all the records after the group by statement.
Is there a way for this directly from sql?
For example, having a table with users I want to select the different towns and the total number of users
select town, count(*) from user
group by town
I want to have a column with all the towns and another with the number of users in all rows.