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: Vadim Tropashko <nospam_at_newsranger.com>
Date: Fri, 18 May 2001 16:41:29 GMT
Message-ID: <ZgcN6.7804$6j3.650225@www.newsranger.com>

select sb2, sc2, b1 from
(select sum(b2) sb2, b1 from b2 group by b1), (select sum(c2) sc2, c1 from c2 group by c1) where b1 = c1

I thought this solution was clear from my previous message, but by multiple other responces see that maybe not (this could be attributed to notorious SQL nonorthogonality as well:-).

In article <9e0me6$fcfl$1_at_ID-86706.news.dfncis.de>, Stefan Peschke says...
>
>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
>
>
>Relationen
>a -->> b
>a -->> c
>
>and I want
>a sum(b) sum(c)
>
>in ONE row:
>
>a sum(b2) sum(c2)
>1 3 12
>
>Does anyone have a clue?
>
>Thank You,
>
>Stefan Peschke
>
>
Received on Fri May 18 2001 - 11:41:29 CDT

Original text of this message

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