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 -> Re: SELECT col_a, (SELECT col_b .....

Re: SELECT col_a, (SELECT col_b .....

From: Stephen Bell <stephen.bell_at_cgi.ca>
Date: Sat, 21 Jul 2001 21:26:58 GMT
Message-ID: <3B431EFC.B7EAAF69@cgi.ca>

Hi Frank,

The name I know it by is an "inline view".. You're right...it could be written in the "old" style as you've shown it if table b exists..
The benefit of the inline view is that your SELECT in your from clause can produce a set of records that don't exist as a permanent table..e.g. joins, group functions, etc.

Hope this helps clarify it,

Steve

Frank wrote:

> Hi!
> Oracle 8.1.6/Windows2000
>
> I have found that Oracle now handles queries with the form:
> SELECT col_a,
> (SELECT col_b FROM table_b WHERE find only one row)
> FROM table_a a
> WHERE find stuff;
>
> What is this construction called ? (so I can search for it in the
> documentation)
> How does Orcale optimize this ?
> It seems to me that a expression like this could be rewritten to a "old"
> query like:
> SELECT col_a, col_b
> FROM table_a a, table_b
> WHERE a.id=b.id(+);
>
> Is that happening behind the scenery?
>
> Frank
  Received on Sat Jul 21 2001 - 16:26:58 CDT

Original text of this message

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