sql get count of rows in group by code example Example: sql count group by SELECT gender, COUNT(*) FROM people GROUP BY gender;