How can I update data into Table A with Single Update query?
CodePudding user response:
Try something like : (I haven't tested it)
BEGIN TRANSACTION
UPDATE tableA
SET tableA.Price = tableB.Price
FROM tableA, tableB
WHERE tableA.Item = tableB.Item
UPDATE tableA
SET tableA.Limit = tableC.Limit
FROM tableA, tableC
WHERE tableA.CName = tableC.CName
COMMIT
CodePudding user response:
try this request
UPDATE A a
SET a.price = b.price, a.limit = c.limit
FROM B b, C c
WHERE a.item = b.item and a.cname = c.cname;