标签:邮箱 rom sel desc 部门 员工 函数 select limit
select
要查询的东西
from
表
where
条件
order by 排序的字段|表达式|函数|别名 【asc|desc】
SELECT * FROM employees ORDER BY salary DESC;
SELECT * FROM employees ORDER BY salary ASC;
SELECT *
FROM employees
WHERE department_id >= 90
ORDER BY hiredatE ASC
SELECT *,salary*12*(1+IFNULL(commission_pct,0)) AS 年薪
FROM employees
ORDER BY salary*12*(1+IFNULL(commission_pct,0)) DESC
# 或者可以按照别名排序
ORDER BY 年薪
SELECT LENGTH(last_name) 字节长度,last_name,salary
FROM employees
ORDER BY 字节长度 DESC
SELECT *
FROM employees
ORDER BY salary ASC, employee_id DESC
select *
from employees
where email like ‘%e%‘
order by length(email) desc, department_id asc;
标签:邮箱 rom sel desc 部门 员工 函数 select limit
原文地址:https://www.cnblogs.com/qifanren/p/14814444.html