ORDER BY
子句排序
ASC
(ascend):升序DESC
(descend):降序ORDER BY
子句在SELECT语句的结尾ORDER BY + 字段
后面没有显式地指明排序方式,则默认按照升序排列ORDER BY
中使用,不能在WHERE
中使用WHERE
和ORDER BY
同时出现时,WHERE
要紧跟FROM
,把ORDER BY
往后放https://www.nowcoder.com/exam/oj/ta?tpId=298
select cust_name
from Customers
order by cust_name desc;
select cust_id,order_num
from Orders
order by cust_id asc,order_date desc;
select quantity,item_price
from OrderItems
order by quantity desc, item_price desc;
select vend_name
from Vendors
order by vend_name desc;