python集合运算符 数据库关系运算?
数据库关系运算?
A 并 B 去掉重复记录----unionselect 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 minusselect distinct deptno from employee_ccy )希望对你有帮助
版权声明:本文内容由互联网用户自发贡献,本站不承担相关法律责任.如有侵权/违法内容,本站将立刻删除。