MySQL数据库4 order by 升序降序 多重排序

-- select * from users
-- order by排序
-- desc降序
-- 升序 由小到大
-- 下列两条都是升序,其中asc加不加都可以,因为他们是等价的 -- select * from users order by status -- select * from users order by status asc
-- 降序 由大到小
-- select * from users order by status desc
-- select * from users order by id desc
-- 多重排序
-- 先id降序,再状态升序,多重排序的时候asc加不加都可以,不影响
-- select * from users order by id desc, status 

  

 

 

 

posted @ 2022-11-08 00:24  文采呱呱  阅读(289)  评论(0)    收藏  举报