so the answer should be:
SELECT A.DEPTNAME, AVG(A.EMPSALARY)
FROM EMP A
WHERE A.EMPSALARY > (SELECT AVG(B.EMPSALARY)
FROM EMPLOYEE B
GROUP BY B.DEPTNAME
WHERE B.DEPTNAME = A.DEPTNAME )
GROUP BY A.DEPTNAME
IS IT RIGHT?
i HAVE NO SQL AT HOME...
This post has been archived. It cannot be replied.