Is the following possible?
I have 2 tables, for example:
Location:
Location_key | Location | Site_key
1 | First Floor | 100
2 | Second Floor | 100
3 | Third Floor | 100
4 | Fourth Floor | 200
5 | Fifth Floor | 200
Sub_Location:
Sub_Location_key | Sub_Location | Location_key
1 | Room A | 1
2 | Room B | 2
3 | Room C | 3
4 | Room D | 1
5 | Room E | 2
I want to get all the sub locations within each location. So for example, if I’m getting site 100, I need to return something like:
First Floor
----------
Room A
Room D
Second Floor
----------
Room B
Room E
edit