我的最终目标是能够将多个列值从一个表更新到另一个表,而无需将每个列都写出来。
我在IBM的网站上发现了以下内容:Link)
UPDATE items
SET (stock_num, manu_code, quantity) =
( (SELECT stock_num, manu_code FROM stock
WHERE description = 'baseball'), 2)
WHERE item_num = 1 AND order_num = 1001;
UPDATE table1
SET (col1, col2, col3) =
((SELECT MIN (ship_charge), MAX (ship_charge) FROM orders), '07/01/2007')
WHERE col4 = 1001;
我接受了这个,并试图在我的最后创建它,但我一直在'('""错误。
附近得到一个"不正确的语法。UPDATE XX__JeremyTempTable2
SET (OP__DOCID, SexualPrefCode) =
(SELECT OP__DOCID, SexualPrefCode FROM FD__CLIENTS
WHERE CLIENTKEY = 726148)