数据库查询语句问题,查询数量前十的信息数,进行排序

数据库查询语句问题,查询数量前十的信息数,进行排序,第1张

select channelid as 频道,count(channelid) as 小计 from pe_soft where channelid = '2' group by channelid order by 2

select inputer as 录入,channelid as 频道,count(channelid) as 小计 from group by inputer,channelid order by 3

select top 10 inputer as 录入,count(channelid) as 小计 from pe_soft where channelid = '2' group by inputer order by 2

可以通过 “order by 字段名 asc (desc)” 命令进行排序。

sql:select from tablename order by id DESC;

用 DESC 表示按倒序排序(即:从大到小排序) ,用 ACS 表示按正序排序(即:从小到大排序)。

参考资料

csdncsdn[引用时间2018-1-28]

以上就是关于数据库查询语句问题,查询数量前十的信息数,进行排序全部的内容,包括:数据库查询语句问题,查询数量前十的信息数,进行排序、怎么让SQLServer的id按照数字大小顺序排序、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/9823817.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-02
下一篇 2023-05-02

发表评论

登录后才能评论

评论列表(0条)

保存