mysql 如何以2个字段排序?

mysql 如何以2个字段排序?,第1张

select * from (select* from user ORDER BY `num` DESC)group by 'time' order by 'time' DESC好像是这样 用group

select * from tablename order by col1,col2,col3

还可以指定每个列的排序顺序

select * from tablename order by col1 asc,col2 desc,col3 asc

你这样写是错误的,首先你应该再分析下你的需求,你的要求实际上就是先筛选出 tongji>tongji2 的数据,再排序,你那样写是错误的,order后面不能跟表达式

select * from $member where tongji>tongji2 order by tongji desc Limit 0,10


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

原文地址: http://outofmemory.cn/zaji/6129617.html

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

发表评论

登录后才能评论

评论列表(0条)

保存