megacolorboy

Back

Published on August 13th, 2021

MySQL

How to update values of a column from one table to another?

Sometimes, I come across situations where I would need to update a newly added in a pivot table and this query does come in handy:Hope you found this useful too!

1 minute read

Sometimes, I come across situations where I would need to update a newly added in a pivot table and this query does come in handy:


UPDATE table_a INNER JOIN table_b ON table_b.col_x = table_a.col_x SET table_a.col_y = table_b.col_y;

Hope you found this useful too!