update table data from another table sql server code example
Example 1: sql update from another table
UPDATE table1
SET table1.Price = table2.price
FROM table1 INNER JOIN table2 ON table1.ID = table2.id
-- WHERE table1.id=...
Example 2: sql update with field from another table
UPDATE table1
SET price=(SELECT price FROM table2 WHERE table1.id=table2.id);