List Info

Thread: Re: SQL PROBLEM




Re: SQL PROBLEM
country flaguser name
United States
2008-03-30 05:38:01

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
>

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )