首页 > 数据库技术 > 详细

Mysql where not

时间:2021-07-15 01:00:59      阅读:19      评论:0      收藏:0      [点我收藏+]

 

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) ;

 

技术分享图片

 

Mysql where not

原文:https://www.cnblogs.com/yaoze2018/p/15013441.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!