| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Simple SQL?
Goran Sliskovic wrote:
> It will return wrong result.
> before group by result set is:
>
> a b1 b2 c1 c2
> 1 1 1 1 3
> 1 1 1 1 4
> 1 1 1 1 5
> 1 2 1 1 3
> 1 2 1 1 4
> 1 2 1 1 5
>
> So it will return 3xsum(b2) and 2xsum(c2).
Then maybe...
SELECT a, SUM(b2)/COUNT(c2), SUM(c2)/COUNT(b2)
FROM tblA, tblB, tblC
WHERE a = b1 AND a = c1
GROUP BY a
Larry Coon
University of California
larry_at_assist.org
and lmcoon_at_home.com
Received on Thu May 17 2001 - 17:19:10 CDT
![]() |
![]() |