Julian
Joined: 26/04/2007 18:25:11
Messages: 40
Location: UK
Offline
|
Hi Marc, Alan,
For the superceded ones, can't we just do an update? I tried this for the last two fips bulletins and it seems to work (in mysql4):
Code:
CREATE TABLE adminmap (cc char(2) default NULL, old int(11) default NULL, new int(11) default NULL);
INSERT INTO `adminmap` VALUES ('AF',20,39),('AF',21,40),('BG',80,84),('BC',7,11),('CF',3,13),
('DJ',1,1),('DJ',2,6),('DJ',3,7),('DR',5,34),('DR',17,35),
('GA',3,3),('ID',9,36),('ID',19,37),('ID',20,38),('IR',31,40),
('LI',2,19),('LI',5,20),('MY',14,14),('MD',13,57),('MD',49,58),
('MO',7,45),('MO',13,46),('MO',19,47),('MO',20,48),('MO',24,49),
('NZ',10,10),('NI',11,11),('SG',8,13),('SG',4,14),('SE',3,3),('SE',13,24),
('SE',15,25),('SE',16,26),('SE',21,27),('BP',5,10),('BP',4,11),('TZ',1,26),
('SO',11,18),('SO',15,19),('SO',16,20);
update geonames set admin1_code = (select new from adminmap
where country_code=cc and admin1_code=old)
where country_code in (select cc from adminmap) and admin1_code in (select old from adminmap);
For the complex changes like Togo, we need boundaries
Julian
[code]
|