I would like to replace a column of data in a table.
TableA
Uid - int
AnotherUid - int
TableB
Uid - int
TableA.uid = Table.B uid And I am trying to replace the TableB.Uid with TableA.AnotherUid
Select * from TableB a, TableA b where a.uid=b.uid
update TableB set a.uid=b.AnotherUid
I got a SQL syntax error from MySQL at TableB set a.uid=b.AnotherUid.
Please kindly help.
UPDATE TableB T
SET T.uid =
(SELECT AnotherUid
FROM TableA A
WHERE A.uid = T.uid)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With