子查询中的 e.deptno如果替换成 emp.deptno得到的结果为什么不一样?
1)select empno,ename,sal, (select avg(sal) from emp where deptno=e.deptno) avgsal
from emp e
where sal > (select avg(sal) from emp where deptno=e.deptno)
2)select empno,ename,sal, (select avg(sal) from emp where deptno=emp.deptno) avgsal
from emp e
where sal > (select avg(sal) from emp where deptno=emp.deptno)