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!

Question regarding hierarchial query

user400097May 9 2020 — edited May 10 2020

Hi all

I have a problem related to hierarchial query when I use connect by prior

I have a table with the data as described in the picture (Total 180 rows, from different structure id's)

structure_id 2 has 21 rows.

When I write the next SQL it return 265 rows. why?

this is the SQL:

select structure_id,

catalog_id,

master_item_id,

detailed_item_id

from items_structure

where structure_id=2

start with master_item_id='TOTAL'

connect by prior detailed_item_id=master_item_id

pastedImage_0.png

Comments
Post Details
Added on May 9 2020
6 comments
154 views