数据库-union、union all、intersect、minus函数
作者:互联网
--union
--把两个查询结果进行拼接
--会对重复的数据进行过滤
select * from emp where deptno in(10,20)
union
select * from emp where deptno = 20;
--union all
--不会过滤 显示两个表中和 13条
select * from emp where deptno in(10,20)
union all
select * from emp where deptno = 20;
--intersect
--求两个查询结果的交集
select * from emp where deptno in(10,20)
intersect
select * from emp where deptno = 20;
--minus
--第一个查询结果 减去第二查询结果
select * from emp where deptno in(10,20)
minus
select * from emp where deptno = 20;
标签:20,union,--,emp,intersect,deptno,where,minus,select 来源: https://blog.csdn.net/Wxiaozhong/article/details/123232426