开发者

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜