mysql 搜尋資料結果排序
基本:
升冪(可以不用寫ASC)
降冪
混合
ORDER BY Optimization
- SELECT * FROM t1
- ORDER BY key_part1,key_part2,... ;
升冪(可以不用寫ASC)
- SELECT * FROM t1 ORDER BY key_part1 ASC;
降冪
- SELECT * FROM t1 ORDER BY key_part1 DESC;
混合
- SELECT * FROM t1 ORDER BY key_part1 DESC, key_part2 ASC;
ORDER BY Optimization
留言