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

Home -> Community -> Usenet -> c.d.o.server -> No subselect in SELECT clause?

No subselect in SELECT clause?

From: Franz Mueller <franz.mueller_at_orbis.de>
Date: Thu, 21 Oct 1999 09:42:39 GMT
Message-ID: <380edeee.10772069@news.salink.net>


Hi,
I have the following problem:

Col1	Col2
A	1
A	2
B	1
B	3

The result I want is
A	2
A	2
B	4
B	4

where the second number is the sum of the As or Bs

In MSSQL Transact-SQL I can do the following:

SELECT col1 w1 , (select sum(col2) from t1 where col1=w1) from t1 which returns exactly what I want.

How can I do this in ORACLE (which does not accept subselects in the SELECT part)?

Franz Received on Thu Oct 21 1999 - 04:42:39 CDT

Original text of this message

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