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: Billy Verreynne <vslabs_at_onwe.co.za>
Date: Wed, 18 Sep 2002 11:28:51 +0200
Message-ID: <am9h1u$rub$1@ctb-nnrp2.saix.net>


Proffesional newbie wrote:

> Hi i found the next select statement and i was wondering what this
> select statement in the from clause does ?
> It is the first time i see this.

Basically it is a view. Consider this view: CREATE VIEW foo AS SELECT * FROM table2 WHERE col1 < SYSDATE

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.

--
Billy
Received on Wed Sep 18 2002 - 04:28:51 CDT

Original text of this message

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