from절에서 subquery를 사용해 특정 그룹 집계 결과를 새 필드 값처럼 만들고, 그 값으로 where절에서 조건을 작성한다. -- having절 사용 select d.dname "부서명", ROUND(avg(e.sal),2) "평균 급여" from dept d, emp e where d.deptno = e.deptno group by d.dname having count(e.empno) >= 2; 그룹 조건을 나타낼 때는 having절을 사용한다고 배웠다. 같은 질의를 having절을 사용하지 않고 derived relation(subquery)을 사용해 작성하는 방법은 다음과 같다. -- subquery 사용 select d.dname "부서명", ROUND(avg(e1.sal),2) "평균 급..