mima
11-01-2007, 05:23 AM
Hi,
I’m having following table structure
Table Locations
ID ParentID
1 0
2 1
3 2
4 3
5 4
Table Properties
LocationID Location
1 Europe
2 Western Europe
3 Germany
4 Bavaria
5 Berlin
Represented data in this case means that I have location Europe with its child location Western Europe with child location Germany with child location Bavaria with child location Berlin.
Europe > Western Europe > Germany > Bavaria > Berlin
Now I need SQL statement to perform search on following way:
For example if I search for Western Europe it needs to return not just Western Europe but its child’s to, in this case Germany, Bavaria and Berlin.
Any help appreciated,
Thanks in advance
I’m having following table structure
Table Locations
ID ParentID
1 0
2 1
3 2
4 3
5 4
Table Properties
LocationID Location
1 Europe
2 Western Europe
3 Germany
4 Bavaria
5 Berlin
Represented data in this case means that I have location Europe with its child location Western Europe with child location Germany with child location Bavaria with child location Berlin.
Europe > Western Europe > Germany > Bavaria > Berlin
Now I need SQL statement to perform search on following way:
For example if I search for Western Europe it needs to return not just Western Europe but its child’s to, in this case Germany, Bavaria and Berlin.
Any help appreciated,
Thanks in advance