MySQL排序:SELECT ORDER BY

时间:2025-01-27 21:06:32

SELECT 和ORDER BY结合进行排序:

products表例如以下:

MySQL排序:SELECT ORDER BY

a 按产品名称列进行排序:

MySQL排序:SELECT ORDER BY

b 按多个列进行排序,默认排序顺序为升序:

MySQL排序:SELECT ORDER BY

c 指定排序方向,即指定为降序:

MySQL排序:SELECT ORDER BY

d 对多个列进行排序,先按产品价格降序排列,再按产品名称排列

MySQL排序:SELECT ORDER BY

e 找出某一列最高值或者最低值

MySQL排序:SELECT ORDER BY