Введение в модель данных SQL


Пример 15.7.1


SELECT DEPT.DEPT_NO

FROM DEPT

WHERE (SELECT AVG(EMP_SAL)

FROM EMP

WHERE EMP.DEPT_NO = DEPT.DEPT_NO) IN

(SELECT MAX(EMP1.EMP_SAL)

FROM EMP, DEPT DEPT1

WHERE EMP.DEPT_NO = DEPT1.DEPT_NO

AND DEPT1.DEPT_NO <> DEPT.DEPT_NO

GROUP BY DEPT.DEPT_NO);




- Начало -  - Назад -  - Вперед -