Count rows per group
SQL
Easy
2 views
Problem Description
You need a small city-wise report. From Customers(city), return city and how many customers are in that city.
Constraints
Think: GROUP BY the same column you show
Official Solution
SELECT city, COUNT(*) AS customer_count FROM Customers GROUP BY city;
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!