过滤数据
WHERE
SELECT employee_id, last_name, job_id, department_id
FROM employees
WHERE department_id = 90 ;
比较运算符
基本操作符
SELECT last_name, salary
FROM employees
WHERE salary <= 3000;
其他比较运算符
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
模糊查询