全站数据
8 4 2 0 5 8 1

sql排序倒序怎么写

会计交流 | 简单学习,快乐成才!         
问题更新日期:2024-04-24 05:44:57

问题描述

sql排序倒序怎么写希望能解答下
精选答案
最佳答案

sql中排序倒序使用desc关键字,一般需要和order by 合用,示例sql语句如下:

例如:select * from student order by age desc;

排序采用 order by 子句,order by 后面跟上排序字段,排序字段可以放多个,多个采用逗号间隔,order by默认采用升序(asc),如果存在 where 子句,那么 order by 必须放到where 语句后面。