mysql group by count code example
Example 1: sql groub by count
SELECT COUNT(Id), Country
FROM Customer
GROUP BY Country
Example 2: mysql count grouped rows
SELECT DISTINCT my_field, COUNT(*) FROM my_table GROUP BY my_field;
-- Count of grouped rows:
SELECT COUNT(*) FROM (
SELECT DISTINCT my_field FROM my_table
);