Skip to content
Advertisement

Sql query to select all the sub items in the same table

I have a table in which one column depends another column. The table I have some what resembles the below

I need to filter out the Parent Folder Id’s which points out the root folderID 1. And the output should be like the below table:

Thanks & Regards,

Advertisement

Answer

Try below query:

dbfiddle Link

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