首先,我想更新一个表,然后想要选择更新的行。如何在单个查询中执行此操作。 比方说,我已经按照方式更新了表格
UPDATE suppliers
SET city = (SELECT customers.city
FROM customers
WHERE customers.customer_name = suppliers.supplier_name)
WHERE EXISTS (SELECT customers.city
FROM customers
WHERE customers.customer_name = suppliers.supplier_name)
现在,我如何选择此更新的行
答案 0 :(得分:1)
使用返回来尝试使用oracle:
UPDATE <table> SET (c1) = (v1) WHERE <condition> RETURNING <expression> INTO <variables>