Update with Inner Join SQL Server
hello
I have a small question regarding sql in oracle.
I have a question about Upadting with inner join in sql.
UPDATE MOJOJO
SET MOJOJO.CarMaker = mstMakerModel.Maker
FROM tblCarAuctionList AS MOJOJO INNER JOIN
mstMakerModel ON MOJOJO.CarName = mstMakerModel.Model
It prompts that "CarMaker is not updatable".
Can somebody give me the proper syntax?
Please help me regarding this problem
Re: Update with Inner Join SQL Server
UPDATE tblCarAuctionList
SET tblCarAuctionList.CarMaker = mstMakerModel.Maker
FROM tblCarAuctionList INNER JOIN
mstMakerModel ON tblCarAuctionList.CarName = mstMakerModel.Model
I think you can not use a table MOJOJO with update statement.
Re: Update with Inner Join SQL Server
update t1
set t1.DESCRIPTION = t3.DESCRIPTION
from TBL1 t1 inner join TBL2 t2
on t1.UNIQUE_ID = t2.UNIQUE_ID_2
inner join TBL1 t3
on t2.UNIQUE_ID_1 = t3.UNIQUE_ID
Re: Update with Inner Join SQL Server
UPDATE
Then join the tables that will meet the condition.
TABLEA AS A INNER JOIN TABLEB AS B ON A.F1=B.F1
Then state what's going to change.
SET A.X = 1, B.Y = 2
Then we add a WHERE clause.
WHERE A.Z =10
Tie it all together...
UPDATE TABLEA AS A INNER JOIN TABLEB AS B ON A.F1=B.F1
SET A.X = 1, B.Y = 2 WHERE A.Z =10
Re: Update with Inner Join SQL Server
UPDATE MyTable
SET Column = NewValue
FROM MyTable
INNER JOIN OtherTable ON MyTable.Key = OtherTable.Key
In the above example, only columns in "MyTable" can be updated.
Re: Update with Inner Join SQL Server
Update
[temp Call Data]
Set
Billingcli = Bill_numbermaps.[destcli]
From
Bill_numbermaps
Where
[temp Call Data].billingcli = Bill_numbermaps.sourcecli