问题
I am using SELECT DISTINCT name FROM table
to get a table with distinct names that appear in the column. How can i get an extra column returning the number of times that this specific name have appeared on the column?
回答1:
select name, count(1) from table
group by name;
来源:https://stackoverflow.com/questions/7437619/counting-how-many-times-a-value-appeared