0

首先,我想更新一个表,然后想选择更新的行。如何在单个查询中执行此操作。可以说,我已经按照以下方式更新了表格

    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)

现在,我如何选择这个更新的行

4

1 回答 1

1

使用 Returning 为 oracle 尝试此操作:

UPDATE <table> SET (c1) = (v1) WHERE <condition> RETURNING <expression> INTO <variables>
于 2013-04-29T10:10:14.903 回答