clause

RETURNING

Returns values from directly modified rows. PostgreSQL and SQLite support this extension; details differ. Example target: PostgreSQL 17 and SQLite (local fixture tested).

Formal Syntax & Structure

sql syntaxsql
RETURNING expression [, ...]

Working Example

Example Snippetsql
INSERT INTO customers (id,name) VALUES (4,'Mina') RETURNING id;
SQL Reference