SELECT country, COUNT(country) as total FROM user GROUP BY country ASC
我正在使用此语句显示表格中的记录并显示它们。它显示基于国家/地区的记录并对其进行排序。我需要在总数的基础上对记录进行排序。并相应地显示它们。即我想以DESC顺序显示计数。
答案 0 :(得分:1)
SELECT country, COUNT(country) as total
FROM user
GROUP BY country
order by total desc