[统计]统计的时候能排序么?(在线等待,答对给分)

PI_2002 2002-09-06 10:43:37
统计语句如下:

select t_main.zby,count(t_main.zby) as cjsl
from t_main
where t_main.zby in (select t_man.xm from t_man where t_man.lvl > 1) and (t_main.jjsj between @m_ssj and @m_esj)
group by t_main.zby

我想将统计出来的数据按降序排列,怎么处理
...全文
25 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
icevi 2002-09-06
  • 打赏
  • 举报
回复
加order by count(t_main.zby) ,是想要这样的吗?
iamxia 2002-09-06
  • 打赏
  • 举报
回复
加上
order by cjsl desc

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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