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

Home -> Community -> Usenet -> c.d.o.misc -> SubSelect Statement in Select List????

SubSelect Statement in Select List????

From: Alan C. Fusco, Ph.D. <acfusco_at_ibm.net>
Date: Wed, 16 Sep 1998 10:42:56 -0500
Message-ID: <35ffdcc7.0@news1.ibm.net>


I've just come off a large SQL-Server project and am getting back to Oracle (8.0.4). I'm having a little trouble remembering Oracle syntax vs SQL-Server syntax.

In SQL server I can do the following:

Select

    a.Name,
    'Cost' = (Select sum(amount) from PayDue B where B.name = A.name),     a.Address,
    ...
from

    Names A

How do you put a subselect into the Select list in Oracle? I can put one in the where clause with no problem but I can't seen to do it in the select listing.

Alan

P.S. The example above is made up. I certainly know that I can use a join and groupby to get the same info. The example was just given to show how a subselect in the select list can be done in SQL Server Received on Wed Sep 16 1998 - 10:42:56 CDT

Original text of this message

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