Changes SQL function to add new synonyms
This commit is contained in:
@@ -50,5 +50,7 @@ The table contains the following columns to be populated:
|
||||
| 3 | Natural Earth | abbrev | abbreviation |
|
||||
| 4 | Natural Earth | postal | postal code |
|
||||
| 5 | Natural Earth | gn_name | formal english name |
|
||||
| 6 | Natural Earth | woe_label | woe label name |
|
||||
| 6 | Natural Earth | woe_label | woe label name |
|
||||
| 7 | TIGER | stusps | Abbreviation (USA only) |
|
||||
|
||||
|
||||
|
||||
@@ -140,6 +140,14 @@ INSERT INTO admin1_synonyms(name, rank, adm0_a3, global_id)
|
||||
)
|
||||
);
|
||||
|
||||
-- add woe_label as rank = 7 for US states
|
||||
INSERT INTO admin1_synonyms(name, rank, adm0_a3, global_id)
|
||||
|
||||
SELECT stusps, 7, 'USA', qs_adm1.global_id
|
||||
FROM qs_adm1, tl_2014_us_state
|
||||
WHERE qs_adm1.qs_a1 = tl_2014_us_state.name;
|
||||
|
||||
|
||||
-- remove all cases where name is NULL
|
||||
DELETE FROM admin1_synonyms WHERE name IS NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user