How to Update Data Using join in SQL
Posted in
SQL | Joins August 14, 2019
In this article I am going to explain how to update data using join in SQL.
Introduction
In this article I am going to explain how to update data using join in SQL. Join operator is used to fetch data from two or more than two table. If you want to update any value in a table based on condition in other table then we use join. Join create a relation between two table.
Statement that update data in mcninvoices table
UPDATE dbo.mcninvoices
SET invoicetotal=50000
FROM dbo.mcninvoices JOIN dbo.mcnvendors
ON dbo.mcninvoices.vendorid = dbo.mcnvendors.vendorid
WHERE vendorname='vipendra'
|
Data in macinvoices table before update operation
Data in macinvoices table after update operation