oracle中scott的的分页查询的简单问题,查找每个部门最高工资的人的详细信息
select*fromempt1,(selectmax(sal)t2maxsalfromempgroupbydeptno)t2wheret1.deptno=t2.dept...
select * from emp t1, (select max(sal) t2maxsal from emp group by deptno) t2 where t1.deptno=t2.deptno and t1.sal=t2maxsal;
select emp.ename from emp t1, (select max(sal) t2maxsal from emp group by deptno) t2 where t1.deptno=t2.deptno and t1.sal=t2.t2maxsal;
是这个才对 展开
select emp.ename from emp t1, (select max(sal) t2maxsal from emp group by deptno) t2 where t1.deptno=t2.deptno and t1.sal=t2.t2maxsal;
是这个才对 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询