Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

START WITH causing no rows to return

DonbotJun 9 2009 — edited Jun 10 2009
When I run the following query, I get no rows back.
However, when I comment out the START WITH, I get the expected 120 rows, including six rows with pred = 1.
select pred, succ from
(
  with q as 
  (
    select 1 as n from dual
    union all select 2 as n from dual
    union all select 3 as n from dual
    union all select 4 as n from dual
    union all select 5 as n from dual
    union all select 6 as n from dual
    union all select 7 as n from dual
  )
  select q1.n AS pred, q2.n AS succ 
  from q q1
  join q q2 on q2.n > q1.n
)
connect by prior succ = pred
start with pred = 1;
Am I missing something obvious?

-- Don
This post has been answered by Nicolas Gasparotto on Jun 9 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 8 2009
Added on Jun 9 2009
13 comments
1,593 views