开发者

Order by in SQL

开发者 https://www.devze.com 2022-12-16 17:19 出处:网络
Is it possible toorder a query result based on 2 columns with the first sorting ascending on column1 and the sec开发者_如何学运维ondary sort on column2 in desc?

Is it possible to order a query result based on 2 columns with the first sorting ascending on column1 and the sec开发者_如何学运维ondary sort on column2 in desc?

select * from table1 orderby column1, column2

I believe this SQL statement should work, would adding desc along with the second column work or is there any better way of doing it?


yes

select * from table1 orderby column1 asc , column2 desc
0

精彩评论

暂无评论...
验证码 换一张
取 消