How to MySQL update join with other table

How to MySQL update join with other table

Sometimes we need to update a MYSQL table data based on other table data.

For example order_table field city is NULL, and users_data have a field city, we need to update order_table city from users_table city.

There are many ways to do this, but this query is the simplest one. This sample is for beginner users.

Here is working MySQL query to update MySQL table data from other table.

order_table field user_id and users_table field user_id must be indexed for performance.

Leave a Reply

Your email address will not be published. Required fields are marked *