条件查询之not

(10)not

  • 查询出薪水不包含1600和薪水不包含3000的员工(第一种写法)

select * from emp where sal <> 1600 and sal <> 3000;

条件查询之not

 

  • 查询出薪水不包含1600和薪水不包含3000的员工(第二种写法

select * from emp where not (sal = 1600 or sal = 3000);

条件查询之not

查询出薪水不包含1600和薪水不包含3000的员工(第三种写法)

select * from emp where sal not in (1600, 3000);

条件查询之not

 

  • 查询出津贴不为null的所有员工

select * from emp where comm is not null;

条件查询之not

文章来自:Java培训