以下是查询每个部门中大于部门平均工资的所有员工。请问二者的区别和效率高低...
select e1.ename,e1.sal,e1.deptno 
from emp e1,(select emp.deptno deptno, avg(emp.sal) a_sal from emp group by emp.deptno) e2
where e1.sal>e2.a_sal and e1.deptno=e2.deptno
order by e1.deptno;select e1.ename,e1.sal,e1.deptno from emp e1
join(select emp.deptno deptno, avg(emp.sal) a_sal from emp group by emp.deptno) e2
on (e1.sal>e2.a_sal and e1.deptno=e2.deptno)
order by e1.deptno;