Wednesday, February 13, 2013

[MYSQL] 排序"ORDER BY"


"ORDER BY"要放在最後,可以有第一順位、第二順位...

SELECT *FROM mytable ORDER BY name,phone

排序預設是"升冪",如果在結尾加上DESC則是"降冪"(大到小)

SELECT *FROM mytable ORDER BY name DESC

No comments:

Post a Comment