update using select (mysql)

update Table1 a inner join Table2 b on a.Id = b.Id set a.field2 = b.field1;
How can I update a specific column in the table 1 using other column in a Table2.

2 Responses

update table a
set a.field= b.field
from table a
Inner join table b
on a.id= b.id
@Shobhit Thanks for the heads up :)

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.