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!

getting last descendant from a hierarchical query

user9313409Oct 17 2016 — edited Oct 18 2016

Hello,

I have a query like this that gives me full hierarchy:

SELECT old, new, date,  CONNECT_BY_ISCYCLE "Cycle",LEVEL

FROM table

CONNECT BY NOCYCLE PRIOR new=old

e.g.

AB2010022301
BC2012081502
CD2013031803

what I would like to get is a row like this below for product A. I have a problem with getting last descendant (D in that example)

product     1st descendant     last descendant

A               B                           D

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 15 2016
Added on Oct 17 2016
6 comments
2,147 views