I've got objects with an hierarchical order. Each object has an ID, a parent object (
TO_ID in the table) and a type.
My data is in a table which looks like this:
ID | TO_ID | TYPE 123 | 103 | group 176 | 103 | field 256 | 169 | group 103 | 234 | organization
Now I want to search through the table until I find a parent object with a specific type (I don't know hot many parent object my start object has). How can I solve this with SQL?