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: inline view

Re: inline view

From: John Russell <netnews5_at_johnrussell.mailshell.com>
Date: Thu, 27 Mar 2003 05:10:58 GMT
Message-ID: <cd158vg40qdgb2qbke0ubn91gns260mj27@4ax.com>


On Wed, 26 Mar 2003 14:27:15 +0100, Hanne Iren Midttun <hannem_at_tihlde.org> wrote:
>3)
>select * from geo_vei;
>
>GEOMETRI
>---------------------------------------
>rv6
>rv7
>
>4)
>selcet * from (select navn from metatab where kilde_id =1);
>
>NAVN
>---------------------------------------
>geo_vei
>
>In my head I tought the select 3 and 4 where the same?
>
>regards Hanne

What's inside the ( ) represents a set of data values, not the name of a table.

The outer query can filter these values, or sort them, or group them, or join them. For example, I frequently use a construction like

select * from
(

	select
		count(*) howmany,
		<complicated expression 1> expr1,
		<complicated expression 2> expr2
	...

)
group by expr1, expr2
order by howmany desc;

No need to repeat the expressions because the outer query sees only the column aliases.

John

--
Photo gallery: http://www.pbase.com/john_russell/
Received on Wed Mar 26 2003 - 23:10:58 CST

Original text of this message

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