Local districts table:
`id`, `name`, `province_id`
Local provinces table:
`id`, `name`
Task: copy districts over from another DB with a different provinces table and different province id's.
-
Add a temporary
city_nameto your localdistrictstable. -
Run
Copy_districts.sql. -
Review non-matching districts:
SELECT * FROM districts LEFT JOIN provinces ON provinces.name LIKE districts.city_name; -
Remove the temporary
city_namefromdistricts.