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 -> Re: Select statement in from clause

Re: Select statement in from clause

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Wed, 18 Sep 2002 15:32:48 GMT
Message-ID: <3D889C9D.B865E57@exesolutions.com>


Proffesional newbie wrote:

> > We select from this view:
> > SELECT
> > *
> > FROM foo
> >
> > Replace the view name with its select and you get:
> > SELECT
> > *
> > FROM (SELECT * FROM table2 WHERE col1 < SYSDATE)
> >
> > There is very little difference between SQL 1 and SQL 2. In 2 we simply
> > substituted the name of the view with the actual SELECT statement for that
> > view. Which is exactly what the database engine does with SQL 1.
>
> Thnx !
>
> Can you give me an example why they did not use a view ?
> It is more plesant to read, in mine opinion, when u are using the view.
>
> Thnx again
>
> Dennis

In-line views are used rather than views because they are far more efficient in situations where there is no need for the results of the statement to exist permanently on the hard disk or when the values passed to the WHERE clause are variables dependent upon a specific situation.

Daniel Morgan Received on Wed Sep 18 2002 - 10:32:48 CDT

Original text of this message

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