Skip to content
Advertisement

Oracle SQL Recursive Query When FieldType is Subpage

I have a table PanelDefn which has list following fields

I would like to write a query which recursively gives the data for SubPanel when I query for Panel. It means whenever we encounter FieldType=11 , we need to have recursive query for that. I tried using connect-by.

Advertisement

Answer

I guess you need below query –

This will recursively generate the records by comparing PanelID and Subpanel and then using START WITH clause will filter out the unnecessary records.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement