| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Simple SQL?
Stefan Peschke wrote:
> Hi,
> is there a 'simple' SQL-statement for the following problem?
>
> I have 3 tables
>
> Tbl a
> a
> 1
>
> Tbl b
> b1 b2
> 1 1
> 1 2
>
> Tbl c
> c1 c2
> 1 3
> 1 4
> 1 5
>
> [...]
>
> and I want
> a sum(b) sum(c)
Why did you not simply try the following?
SELECT a, SUM(b2), SUM(c2)
FROM tblA, tblB, tblC
WHERE a = b1 AND a = c1
GROUP BY a
-- Jan HiddersReceived on Thu May 17 2001 - 14:59:55 CDT
![]() |
![]() |