Created
December 13, 2014 20:53
-
-
Save beck03076/87ec1380931cdfe54f22 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# migrate branch names -- | |
INSERT INTO branches(name) | |
SELECT DISCTINCT(BranchName) | |
FROM 527433_iec.iec_branch; | |
# map country ids -- | |
UPDATE branches b | |
INNER JOIN 527433_iec.iec_branch ob | |
ON ob.BranchName = b.name | |
INNER JOIN 527433_iec.iec_country oc | |
ON ob.country = oc.CountryId | |
INNER JOIN countries c | |
ON oc.CountryName = c.name | |
SET b.country_id = c.id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment