Created
July 12, 2014 00:27
-
-
Save failpunk/c69ec07e8ca78a3f29ae to your computer and use it in GitHub Desktop.
MySQL update from another table
This file contains 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
UPDATE sub_campaign | |
SET sub_campaign.name = ( | |
SELECT targeting_type.name | |
FROM targeting_type | |
WHERE targeting_type.id = sub_campaign.targeting_type_id | |
) | |
WHERE sub_campaign.name IS NULL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment