开发者

Counting how many times a value appeared

开发者 https://www.devze.com 2023-04-05 00:29 出处:网络
I am using SELECT DISTINCTname 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

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

精彩评论

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