I would like to be able to update any number of Tables in a Database by referencing another Table that has the data that needs to be updated using INNER JOINS.
Tbl1, Tbl2, Tbl3.
TempTbl.
The fileds in Tb;1- Tbl3 that are to be updated would be ID.
TempTbl would have 2 fields: OldID, NewID
This didn't work for me. The idea is to be able to do it for an arbitrary number of tables.
Thank you.
Tbl1, Tbl2, Tbl3.
TempTbl.
The fileds in Tb;1- Tbl3 that are to be updated would be ID.
TempTbl would have 2 fields: OldID, NewID
Code:
UPDATE Tbl1, Tbl2, Tbl3
((INNER JOIN TempTbl ON Tbl1.ID = TempTlb.OldID)
(INNER JOIN TempTbl ON Tbl2.ID = TempTlb.OldID))
INNER JOIN TempTbl ON Tbl3.ID = TempTlb.OldID
SET Tbl1.ID = TempTbl.NewID,Tbl2.ID =
TempTbl.NewID,Tbl3.ID = TempTbl.NewID;
Thank you.
Comment