Re: how??

From: godmann <allanwtham_at_yahoo.com>
Date: 29 Aug 2001 23:33:22 -0700
Message-ID: <95cd51c.0108292233.57bdc9a9_at_posting.google.com>


crsoza_at_hotmail.com (C. R. Soza) wrote in message news:<c18ea449.0108290742.1e2995e3_at_posting.google.com>...
> select a.ename, a.deptno, a.sal
> from emp a, (select deptno, avg(sal) sal
> from emp
> group by deptno) b
> where a.deptno = b.deptno
> and a.sal <= b.sal
> /

OR

select e1.deptno, e1.ename, e1.sal
from emp e1
where e1.sal < (select avg(e2.sal)

                from emp e2 
		where e1.deptno=e2.deptno
		group by e2.deptno);


Allan W. Tham
DBA Received on Thu Aug 30 2001 - 08:33:22 CEST

Original text of this message