问题:mysql数据库表名address,查询城市city字段出现的次数并按倒序排列
查询语句
select city,count(*)
from address
group by city
order by count(*) desc
执行结果如图,按查询字段(城市)进行分组,统计该字段出现的次数,并按统计结果进行倒序排序
问题:mysql数据库表名address,查询城市city字段出现的次数并按倒序排列
查询语句
select city,count(*)
from address
group by city
order by count(*) desc
执行结果如图,按查询字段(城市)进行分组,统计该字段出现的次数,并按统计结果进行倒序排序