I have a Database Hierarchy that sits somewhat like this
LHID | location | parent
------------------------------
1 | Trim | NULL
2 | Trim - South | Trim
3 | South-1 | Trim - South
What I need to do is select all children of Trim - South. It goes extremely deep and there are around 100 children locations and I've found ways to do it recursively but have had no luck replicating them. I know the logic of going through recursively to select all the children as I have done similar procedures in other languages, just never with SQL so I'm having trouble grasping the exact necessary syntax for it. Any ideas?
See Question&Answers more detail:os