3个回答
展开全部
A 并 B 去掉重复记录----union
select empno, ename ,salary ,deptno from employee_ccy where deptno=10
union
select empno, ename ,salary ,deptno from employee_ccy where salary>100;
--union all 不排序,不去重复
select empno, ename ,salary ,deptno from employee_ccy where deptno=10 union all
select empno, ename ,salary ,deptno from employee_ccy where salary>100;
---交集-----intersect
select empno, ename ,salary ,deptno from employee_ccy where deptno=10
intersect
select empno, ename ,salary ,deptno from employee_ccy where salary>100;
--差集--------minus
select empno, ename ,salary ,deptno from employee_ccy where deptno=10
minus
select empno, ename ,salary ,deptno from employee_ccy where salary>100;
-------------用两个结果集的差集 ,获得
select deptno,dname ,location from department_ccy where deptno in(select deptno from department_ccy
minus
select distinct deptno from employee_ccy );
希望对你有帮助
select empno, ename ,salary ,deptno from employee_ccy where deptno=10
union
select empno, ename ,salary ,deptno from employee_ccy where salary>100;
--union all 不排序,不去重复
select empno, ename ,salary ,deptno from employee_ccy where deptno=10 union all
select empno, ename ,salary ,deptno from employee_ccy where salary>100;
---交集-----intersect
select empno, ename ,salary ,deptno from employee_ccy where deptno=10
intersect
select empno, ename ,salary ,deptno from employee_ccy where salary>100;
--差集--------minus
select empno, ename ,salary ,deptno from employee_ccy where deptno=10
minus
select empno, ename ,salary ,deptno from employee_ccy where salary>100;
-------------用两个结果集的差集 ,获得
select deptno,dname ,location from department_ccy where deptno in(select deptno from department_ccy
minus
select distinct deptno from employee_ccy );
希望对你有帮助
展开全部
“与”、“或”、“非”,例如交集用‘与’
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
并集union 或 union all 前者去重后者不去重
交集intersect
差集minus
比如oracle的例子
http://wenku.baidu.com/view/0f2880bc960590c69ec37603.html
交集intersect
差集minus
比如oracle的例子
http://wenku.baidu.com/view/0f2880bc960590c69ec37603.html
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询