Results from same table twice in same query.
Posted: Fri Dec 17, 2004 8:10 am
Hi guys,
Basically, I have a table set up to hold postcodes, each of which are broken up into areas within that postcode. So each actual location represents one row, while the entry in the postcode column is identical for multiple entries.
My problem is wanting to break down each location into multiple sub-zones. While I could just add new entries, this becomes unweildly and gives rise to the addition of false or redundant zones. So what I wanted to do was to create a zone but link it back to a parent location.
Basically then, if I specified row 412 as my location, then the query would return row 412 as well as any new zones which depend upon that one. This I can do myself.
What if I then wanted to seach by postcode. I would need to return all zones in each postcode, as well as any zones based on the ones returned. This I cant seem to do.
Am I making sense? Can anyone help me out with a structure / query that might do the job?
Thanks.
Basically, I have a table set up to hold postcodes, each of which are broken up into areas within that postcode. So each actual location represents one row, while the entry in the postcode column is identical for multiple entries.
My problem is wanting to break down each location into multiple sub-zones. While I could just add new entries, this becomes unweildly and gives rise to the addition of false or redundant zones. So what I wanted to do was to create a zone but link it back to a parent location.
Basically then, if I specified row 412 as my location, then the query would return row 412 as well as any new zones which depend upon that one. This I can do myself.
What if I then wanted to seach by postcode. I would need to return all zones in each postcode, as well as any zones based on the ones returned. This I cant seem to do.
Am I making sense? Can anyone help me out with a structure / query that might do the job?
Thanks.