CREATE OR REPLACE VIEW V_HZY_SALARY
AS
SELECT D.DEPTNO DNO,D.DNAME DN,
MAX(E.SAL)MAX_SAL,
MIN(E.SAL)MIN_SAL,
AVG(E.SAL)AVG_SAL,
SUM(E.SAL)SUM_SAL
FROM EMP_HZY E ,DEPT D WHERE E.DEPTNO=D.DEPTNO GROUP BY D.DEPTNO,D.DNAME
SELECT E.ENAME,E.SAL,E.DEPTNO
FROM EMP_HZY E
WHERE E.SAL/2>(SELECT AVG_SAL FROM V_HZY_SALARY WHERE DEPTNO=30)
出现单行子查询返回多个行!!新手求高人指导,谢谢。