升序降序

order by DESC   升

order by ASC  降

 

 

USE demo
GO
--对name sex age 列表中的 age 从高到低
--把年龄从高到低顺序显示
SELECT name,sex,age FROM text order by age DESC
--把年龄从低到高顺序显示
SELECT name,sex,age FROM text order by age ASC

posted @ 2018-08-16 20:42  生命不止追求不断  阅读(230)  评论(0编辑  收藏  举报