I’ve got collection of geo objects in database:
There are four Tables:
Countries
Regions
Provinces
Cities
Cities has inter alia ProvinceCode
Provinces has inter alia regionCode
Regions has inter alia CountryCode
And there is fifth Table: Descriptions
ObjectCode
ObjectType(country, region, province, city)
Description.
How to get from Descriptions table, all descriptions from objects which are in the definite country ??
Putting away the soap box, here is an actual solution:
Not actually tested, so watch out for typos! They’re a particular danger with Cut’N’Paste Driven Development.