>
sql中排序倒序使用desc關鍵字,一般需要和order by 合用,示例sql語句如下:
例如:select * from student order by age desc
意思是查詢學生表,以學生年紀倒序排列。
排序採用 order by 子句,order by 後面跟上排序欄位,排序欄位可以放多個,多個採用逗號間隔,order by預設採用升序(asc),如果存在 where 子句,那麼 order by 必須放到where 語句後面。
圖文推薦