MySQL-过滤数据

过滤数据

WHERE

SELECT employee_id, last_name, job_id, department_id 
FROM employees 
WHERE department_id = 90 ;

比较运算符

基本操作符

MySQL-过滤数据

SELECT last_name, salary 
FROM employees 
WHERE salary <= 3000;

其他比较运算符

MySQL-过滤数据

between…and

SELECT last_name, salary 
FROM employees 
WHERE salary BETWEEN 2500 AND 3500;
# WHERE salary>=2500 AND salary<=3500;

in

SELECT employee_id, last_name, salary, manager_id 
FROM employees 
WHERE manager_id IN (100, 101, 201); # 无顺序
# WHERE manager_id=100 OR manager_id=101 OR manager_id=201;

like

模糊查询

逻辑运算符

算数运算符

上一篇:Chapter3_操作符_关系操作符


下一篇:求最小生成树的kruskal算法