升序降序

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

猜你喜欢

转载自www.cnblogs.com/tangtangsimida/p/9489699.html