KeenUser
KeenUser

Reputation: 5525

Find distinct child rows which have more than 1 parent in the same table Oracle

I have a table with following structure

enter image description here

I need to identify all unique 1st level ids which have more than 1 0th level id In this example , query should return 200, 400

How can I acheive that?


Upvotes: 0

Views: 351

Answers (1)

Michael Broughton
Michael Broughton

Reputation: 4055

select 1st_level_id
from your_table
group by 1st_level_id
having count(distinct 0th_level_id) > 1

Upvotes: 1

Related Questions