I'm trying to get all children ids (multi levels) which are related to a parent. I thought using Recursive would do the trick, having attempted the query it's not returning the expected result and I'm not even sure this is the write way to go about this or where I'm going wrong.
Expected result is to return all cities and counties for a specified location.
For example if I pass the id for England (id=1) I'd like to return all the ids associated to it. It can be up to 4-5 level of association
For example
Id Location
----- ---------------
1 England
3 London (as its associated with England)
5 Ealing (as associated with London)
6 Westminster (as associated with London)
7 Camden (as associated with London)
8 Barnet (as associated with London)
. . .
Can someone please point me in the right direction on how to resolve this. Is this the correct way to approach this problem?
thanks.