Coding⏱️ 1 min read📅 2026-06-03

How to Fix: SQL update query using joins

Update SQL query using joins to update a field with a value returned by a join of 3 tables.

Quick Answer: Use an UPDATE statement with a JOIN clause, specifying the table and column to be updated, like this: UPDATE im SET mf_item_number = (SELECT mf_item_number FROM item_master WHERE ...)

To update a field with a value returned by a join of three tables, you can use an UPDATE query with a JOIN clause. The correct syntax is as follows:

💡 Correct Syntax

  • UPDATE table_name SET column_name = (SELECT column_name FROM another_table WHERE condition)

✅ Example

Example Query

  1. UPDATE item_master SET mf_item_number = (SELECT mf_item_number FROM group_master gm JOIN manufacturer_master mm ON gm.manufacturerID = mm.ManufacturerID WHERE gm.manufacturerID = 34)

✨ Best Practice

To avoid using subqueries, consider creating a view or a temporary table that contains the joined data. This approach can improve performance and readability.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions