07 2012 档案
摘要:Oracle经典子查询及分页基础详解一:1.如何显示高于自己部门平均工资的员工的信息。(1)查询出各个部门的平均工资和部门号。select deptNO,avg(sal)mysal from emp group by deptNO;(2)把上面的查询看成是一张子表。select a2.ename,a2.sal,a2.deptNO,a1.mysal from emp a2,(select deptNO,avg(sal)mysal from emp group by deptNO) a1 where a2.deptNO=a1.deptNo and a2.sal>a1.mysal;在fro..
阅读全文