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: Query to return PK sequence gap ??

Re: Query to return PK sequence gap ??

From: DA Morgan <damorgan_at_psoug.org>
Date: Sun, 14 Oct 2007 10:04:27 -0700
Message-ID: <1192381453.559637@bubbleator.drizzle.com>


Serge Rielau wrote:
> DA Morgan wrote:

>> Gokul wrote:
>>> SQL> select * from (select level from dual connect by level < 5);
>>>
>>>      LEVEL
>>> ----------
>>>          1
>>>          2
>>>          3
>>>          4
>>>
>>> SQL>
>>>
>>
>> Works properly in 11.1.0.6.

> Shouldn't this return a cycle error?
> (because the same row in DUAL is returned multiple times).
>
> Cheers
> Serge

CONNECT BY specifies a condition that identifies the relationship between parent rows and child rows of a hierarchy. It isn't, in fact, returning the same row ... it is returning the level. Each recursion is at a different level.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Sun Oct 14 2007 - 12:04:27 CDT

Original text of this message

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