Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Simple SQL?

Re: Simple SQL?

From: Jan Hidders <hidders_at_REMOVE.THIS.win.tue.nl>
Date: 17 May 2001 19:59:55 GMT
Message-ID: <9e1ajr$6or$1@news.tue.nl>

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 Hidders
Received on Thu May 17 2001 - 14:59:55 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US