关于 "Select count(*) as cnt from table order by count(*) group by dc_id"

我不是香烟 2003-10-29 12:50:13
"Select count(*) as cnt from table order by count(*) group by dc_id"(错误)
库里只有一个字段,里面有各种数据,比如:
01
02
01
03
02
04
02
01
03
...
现在要做的是把01,02,03...的记录条数统计出来, 然后按照大小顺序排列
象我这样写的错误在哪里?应该怎么写这个语句?
这样:
"Select count(*) as cnt from table group by dc_id"
只做到了统计,要排序需要怎么修改这个语句~
...全文
309 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
angelheavens 2003-10-29
  • 打赏
  • 举报
回复
"Select count(*) as cnt from table group by dc_id order by dc_id desc"
我不是香烟 2003-10-29
  • 打赏
  • 举报
回复
请我恩高手是否有这样一个语句:
select count(*) as cnt from table group by dc_id having count(*)>! order by cnt desc
我不是香烟 2003-10-29
  • 打赏
  • 举报
回复
angelheavens(龙辉) ( )

我是想比较统计出来的结果的大小~

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧