早教吧 育儿知识 作业答案 考试题库 百科 知识分享

Oracle数据库中查询高于自己部门平均工资的员工信息已经有selecta.*fromempawheresal>(selectavg(sal)fromempwheredeptno=a.deptnoand)and后面是应该加groupbydeptno不然应该加什么呀?

题目详情
Oracle数据库中 查询高于自己部门平均工资的员工信息
已经有 select a.* from emp a where sal >(select avg(sal) from emp where deptno=a.deptno and__)
and后面是应该加group by deptno
不然应该加什么呀?
▼优质解答
答案和解析
select b.* from (
select deptno,avg(sal) as avgsal from emp where deptno='部门名称' group by deptno
) a,emp b
where b.sal>a.sal and a.deptno=b.deptno

试试这个
看了 Oracle数据库中查询高于...的网友还看了以下: