# 排序 Joe 需要根据员工表 ```mysql create table employee ( id serial primary key, name varchar(256), dept varchar(256), salary decimal(12, 4) ); ``` 生成一份报表,首先按部门名称的字典序排序,部门内部按员工工资从高到低排列,那么这个查询应该是: ## 答案 ```mysql select id, name, dept, salary from employee order by dept, salary desc; ``` ## 选项 ### A ```mysql select id, name, dept, salary from employee order by dept, salary; ``` ### B ```mysql select id, name, dept, salary from employee order by dept desc, salary desc; ``` ### C ```mysql select id, name, dept, salary from employee order by dept and salary desc; ``` ### D ```mysql select id, name, dept, salary from employee order by dept, salary, id, name; ``` ### E ```mysql select id, name, dept, salary from employee order by dept, salary desc; ```