开发者

mysql query for counting records

开发者 https://www.devze.com 2023-01-05 22:04 出处:网络
I开发者_高级运维 have records in mysql table like a a a b b and I want output like: a 3 b 2 Is there any mysql query that I achieve thatSELECT field, COUNT(field) FROM table GROUP BY field

I开发者_高级运维 have records in mysql table like

a
a
a
b
b

and I want output like:

a 3
b 2

Is there any mysql query that I achieve that


SELECT field, COUNT(field) FROM table GROUP BY field

0

精彩评论

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