except 和 intersect 的用法

--查询排除 factory = 'A' 的结果集
select * from production where department = '1组'
except
select * from production where factory = 'A'

--查询排除 factory = 'A' and department = '1组' 的结果集
select * from production where department = '1组'
intersect
select * from production where factory = 'A'

 

 
posted @ 2020-08-25 10:39  LI小白  阅读(223)  评论(0编辑  收藏  举报