1. select
  2. 查询列表
  3. from
  4. where
  5. 查询条件
  6. order by
  7. 要排序的字段
  8. asc 升序 #降序dasc
<a name="d34227b9"></a>
### 排序查询

- 升序 asc
- 降序 desc

<a name="5da210a2"></a>
#### 语法:
<a name="pECa5"></a>
#### 案例一

- 查询员工工资,按照工资高低排序

select * from 员工表 order by 工资 asc;

> 注意:sqlserver中asc是写在字段的前面


<a name="rwZ3b"></a>
#### 案例二

- 查询工资大于10000的员工,并按入职时间排序

selcet * from 员工表 where 工资 >=10000 order by 入职时间 asc; ```

案例三

  • 将员工的姓名按首字母排序,并显示姓名长度