开发者

Select the largest number of countries from database

I have a database likes this: - I开发者_如何学运维D --- COUNTRY

This database is filled with data, and there are lots of double entries, but they should be there. What I am trying to do, is select the country with most entries in the database, but still don't know how to put a query together.


SELECT `COUNTRY`, count(`COUNTRY`) FROM `table` GROUP BY `COUNTRY`;


select `country`, count(`country`) as 'count' from `table` group by `country` order by `count` DESC LIMIT, 0,1


SELECT id, country, COUNT(*) as total FROM table GROUP BY country ORDER BY total DESC LIMIT 1
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜