if u want something like this then it works,
select a.deptno, a.dname, (select avg(b.sal) from emp b where a.deptno = b.deptno) hhh from dept a;
DEPTNO DNAME HHH
---------- -------------- ----------
10 ACCOUNTING 2916.66667
20 RESEARCH 2175
30 SALES 1566.66667
40 OPERATIONS
Cheers!




Reply With Quote