×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: SQL
Posted by: Shaun McCoy
Added: Apr 19, 2016 1:42 PM
Modified: Apr 19, 2016 2:02 PM
Views: 22
Tags: mysql
Update a column value with value from separate table.
  1. UPDATE {table1}
  2. INNER JOIN {table2} ON {table2}.{COLUMN} = {table1}.{COLUMN}
  3. SET {table1}.{COLUMN} = {table2}.{COLUMN}
  4. WHERE {table2}.{COLUMN} = {table1}.{COLUMN}