日期:2014-05-18 浏览次数:20540 次
select 城市,出现次数= count(1) from table group by 城市
------解决方案--------------------
select 城市,sum(出现次数) as 出现次数
from 表名
group by 城市
------解决方案--------------------
城市 出现次数 北京 12 上海 5 ... ... select 城市 ,count(1)as 出现次数 from t group by 城市
------解决方案--------------------
你们也太快了吧,刚才看没有回
------解决方案--------------------
select
城市,count(*) as 出现次数
from
表
group by
城市
order by
出现次数 desc
select 城市,count(*) as 出现次数 from 表 group by 城市 order by count(*) desc