Created
July 29, 2010 15:24
-
-
Save adamjforster/498411 to your computer and use it in GitHub Desktop.
Example SQL update statements using a join for PostgreSQL and MySQL.
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
/* PostgreSQL */ | |
UPDATE a | |
SET a.b_id = b.id | |
FROM b | |
WHERE a.b_name LIKE b.name; | |
/* MySQL */ | |
UPDATE a, b | |
SET a.b_id = b.id | |
WHERE a.b_name LIKE b.name; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment