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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to find table levels hierarchy?

Albert ChaoJul 2 2021 — edited Jul 2 2021

I tried using user_constraints and also used START WITH and connect by the concept

Below Query I used
Select table_name, level from ( select table_name, constraint_name, r_constraint_name
from user_constraints where table_name in (select t_name from my_table where is_active =1))
start with constraint_type = 'P'
connect by prior constraint_name = r_constraint_name;

This post has been answered by Solomon Yakobson on Jul 2 2021
Jump to Answer
Comments
Post Details
Added on Jul 2 2021
11 comments
2,022 views