How do I join a table on its self i.e. lets say for example that I have a table with the following schema i.e.
Table 1, with columns ID, Name, ParentId and lets say ParentId was a forgeign key for a matching row in the same table, how would I get all rows returned with all rows containing parented in order so e.g.
1, aaa, null
And lets say i made a query which said i want all rows with an id of 1 and all child rows from 1 whether there child or child of child,or child of child of child and so on, .
So e.g. lets say i wanted all row related to id of . So in this instance i'd get the following returned in this order i.e.
1, aaa, null ---> Parent
2, bbb,1 ----> Child
3,ccc,2 ----> Child of child with parent od 1