Hi
I have the following table:-
childid parentid description
---------------------------------------------
1 1 Company 1
2 1 Office 1
3 2 Ground Floor
4 3 Section
5 4 Room 1
6 4 Room 2
7 4 Room 3
8 1 Office 2
9 1 Office 3
If I want the details of childid 6 I would like to return:-
Company 1 - Office 1 - Room 2
or
childid 9 would return
Company 1 - Office 3
How do I write a sql statement to do this?
Regards
Tim
I have the following table:-
childid parentid description
---------------------------------------------
1 1 Company 1
2 1 Office 1
3 2 Ground Floor
4 3 Section
5 4 Room 1
6 4 Room 2
7 4 Room 3
8 1 Office 2
9 1 Office 3
If I want the details of childid 6 I would like to return:-
Company 1 - Office 1 - Room 2
or
childid 9 would return
Company 1 - Office 3
How do I write a sql statement to do this?
Regards
Tim