If I rmv d_amount from group by clause then I get one sum amount 
applied to all three items returned from subquery ie
600 for x
600 for y
600 for z
the good part is my main query now only returns three rows (which I 
want)not nine. But answer is wrong.

> why you are using 'D_AMOUNT' in GROUP BY clause:
> 
> Try the following:
>  
> select DISTINCT SUM(D_AMOUNT) ,D_TYPE
> FROM TYPE_DONATION, DONATIONS
> WHERE TYPE_DONATION. DONATION_ ID IN (SELECT DISTINCT DONATION_ID FROM
> DONATIONS WHERE MEMID = 4)
> GROUP BY D_TYPE
> 
> thanks
>


Reply via email to