--sal为员工工资

select * from emp;

SQL in查询

 

--查询工资等于1500或3000或5000的用户信息

select * from emp where sal in (1500, 3000, 5000);
select * from emp where sal = 1500 or sal = 3000 or sal = 5000;

SQL in查询

 

--查询工资不是1500 && 3000 && 5000 的用户信息

select * from emp where sal not in (1500, 3000, 5000);
select * from emp where sal != 1500 and sal != 3000 and sal != 5000;
select * from emp where sal <> 1500 and sal <> 3000 and sal <> 5000;

 

--数据库不等于有两种表示:!= <>

相关文章:

  • 2021-06-06
  • 2021-10-25
  • 2022-12-23
  • 2021-10-31
  • 2022-12-23
  • 2021-05-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-04
  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案