查询没有雇员的部门信息

--查询没有雇员的部门信息





 ---用连接查询1
select distinct A.* from dept A,emp B
where 
B.deptno not in A.deptno



select deptno,dname,loc from dept where dname= 
(select dname from( 
select * from emp a full join dept b on a.deptno = b.deptno
  minus
select * from emp a left join dept b on a.deptno = b.deptno  ))

select * from emp a full join dept b on a.deptno = b.deptno
  minus
select * from emp a left join dept b on a.deptno = b.deptno  


你可能感兴趣的:(数据库)