I\'m pretty new to SQL, trying to wrap my head around it, but it\'s getting a little confusing. Here\'s a simplified version of what I\'m working with.
I have this
That would be easier to understand if you use a query designer. I am putting a picture of view designer of SQL Server. I hope it can help.
This is how you can find the children:
And I suggest you to allow null for parent_id field and use null instead of 0 so you can make a relation from id (as pk) to parent_id (as fk). That would make everything easier while using the designer.
Let me know if you also need an example for finding the grandchildren.