开发者

mysql query for counting records

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜