返回更新

UPDATE 语句的这种变体允许返回受更新影响的行中的值。

Update returning

This variant of UPDATE statement allows to return the values from the row(s) affected by the update.

Standard No support in SQL:2003
DB2 UPDATE ... RETURNING ... INTO ... since 9.7.

Only returns the updated values, see the documentation.

Firebird UPDATE ... RETURNING ... since 2.1.

Can return both old and new values using old. or new. prefixes but for at most one row, see the documentation.

Ingres ?
Linter ?
MonetDB ?
MSSQL UPDATE ... OUTPUT ... since MS SQL Server 2005.

Can return both old and new values using inserted. or deleted. prefixes, see the documentation.

MySQL No support in 5.7.
Oracle UPDATE ... RETURNING ... INTO ...

Supports retrieving values of multiple rows with BULK COLLECT INTO, see the documentation.

PostgreSQL UPDATE ... RETURNING ... since 8.2.

Only returns the updated values, see the documentation.

SQLite No support in 3.8.
Virtuoso ?
最后修改: 2025年04月11日 星期五 14:33