Mysql where not
1. 表格内容:
select * from emp_info;

2. 查询 salary 不大于 4000 的 员工信息
select * from emp_info a where not a.salary > 4000 ;
结果:

3. 查询 salary 不大于 4000, 且 kpi 为 A 的员工信息
select * from emp_info a where (not a.salary > 4000) and a.kpi = 'A' ;

4. 查询 salary 不大于 4000且 kpi 不为 A 的员工信息
select * from emp_info a where not (a.salary > 4000 and a.kpi = 'A') ;

5. 查询salary 不在 4000-5000 的员工信息:
select * from emp_info a where a.salary not between 4000 and 5000;

钟声敲响了日落,柏油路跃过山坡,一直通向北方的是我们想象,长大后也未曾经过~

浙公网安备 33010602011771号