Using group by on two fields and count in SQL

I think you’re looking for: SELECT a, b, COUNT(a) FROM tbl GROUP BY a, b

Leave a Comment