📅  最后修改于: 2022-03-11 15:05:25.310000             🧑  作者: Mango
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
);