Oracle 查大于在部门平均工资的雇员姓名(ENAME),编号(EMPNO),部门编号(DEPTNO)和在部门的平均工资(SAL)

2025-01-30 14:02:20
推荐回答(3个)
回答1:

(
SELECT
EMP.ENAME,
EMP.EMPNO,
EMP.DEPTNO,
avg_t.AVG_SAL AS SAL
FROM
EMP,
(
SELECT
DEPTNO,
AVG( SAL ) AS AVG_SAL
FROM
EMP
GROUP BY
DEPTNO
) avg_t
WHERE
EMP.DEPTNO = avg_t.DEPTNO
AND EMP.SAL > avg_t.AVG_SAL

回答2:

年轻人,作业要自己做

回答3:

都没有认真琢磨,挨个就贴出来了