Created
August 31, 2017 09:37
-
-
Save Kcko/23d64fdea0ceadf4c568b4b09edec84e to your computer and use it in GitHub Desktop.
Mysql update join
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
| UPDATE table A | |
| JOIN table B ON {join fields} | |
| JOIN table C ON {join fields} | |
| JOIN {as many tables as you need} | |
| SET A.column = {expression} | |
| Example: | |
| UPDATE person P | |
| JOIN address A ON P.home_address_id = A.id | |
| JOIN city C ON A.city_id = C.id | |
| SET P.home_zip = C.zipcode; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment