SQL ORDER BY 關(guān)鍵字
order by 關(guān)鍵字用于對結(jié)果集按照一個列或者多個列進行排序。
order by 關(guān)鍵字默認按照升序?qū)τ涗涍M行排序。如果需要按照降序?qū)τ涗涍M行排序,您可以使用 desc 關(guān)鍵字。
1. order by 語法
select column_name,column_name
from table_name
order by column_name,column_name asc|desc;
from table_name
order by column_name,column_name asc|desc;