查询没有雇员的部门信息

<span style="font-size:18px;">--查询没有雇员的部门信息</span>





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



<strong>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  ))</strong>

<strong>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  </strong>


你可能感兴趣的:(oracl,查询没有雇员的部门信息)