SQL Dialects Reference/Write queries/Update returning

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Update returning[edit]

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 ?