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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Hotsos Symposium, Day 1

Re: Hotsos Symposium, Day 1

From: Vladimir Begun <Vladimir.Begun_at_oracle.com>
Date: Thu, 10 Mar 2005 09:52:25 -0800
Message-ID: <42308959.70804@oracle.com>


Thomas

I believe, the point here is as follows the view like this:

CREATE VIEW pivot
AS

   SELECT ROWNUM rn FROM dual CONNECT BY 1 = 1 /

OR

WITH pivot AS (

   SELECT ROWNUM rn FROM dual CONNECT BY 1 = 1 )
SELECT * FROM pivot
/

Would be an "*endless*" row source. You can put any condition that is true-evaluated -- there should be just something, otherwise it won't be possible to run hierarchical query.

LEVEL there is used to limit the number of returned rows, in case one would like to limit he/she can use LEVEL w/o extra 'true' condition 1 = 1 or dummy = dummy or whatever = whatever.

-- 
Vladimir Begun
The statements and opinions expressed here are my own
and do not necessarily represent those of Oracle.


Thomas Day wrote:

> I guess that what I don't understand is why the 1=1 is in there at
> all. The following produces 365 rows of output for me. Does the 1=1
> perform a useful function? I understand that it evaluates as true. I
> don't understand why you feel it's needed.
>
> SELECT TRUNC(SYSDATE,'YEAR') + LEVEL - 1
> FROM (SELECT 'X' FROM DUAL WHERE rownum = 1)
> CONNECT BY
> --1 = 1 AND
> LEVEL < TRUNC(SYSDATE+366,'YEAR') - TRUNC(SYSDATE,'YEAR') + 1
> /
> --
> http://www.freelists.org/webpage/oracle-l
-- http://www.freelists.org/webpage/oracle-l
Received on Thu Mar 10 2005 - 13:02:15 CST

Original text of this message

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