Counting how many times a value appeared
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?
select name, count(1) from table
group by name;
精彩评论