Skip to main content

UPDATE statement

Definition

The UPDATE statement allows you to update rows of a table.

SQL Syntax

[ WITH [ RECURSIVE ] with_query [, ...] ]
UPDATE [ ONLY ] table_name [ * ] [ [ AS ] alias ]
SET { column_name = { expression | DEFAULT } |
( column_name [, ...] ) = [ ROW ] ( { expression | DEFAULT } [, ...] ) |
( column_name [, ...] ) = ( sub-SELECT )
} [, ...]
[ FROM from_item [, ...] ]
[ WHERE condition ]
[ RETURNING * | output_expression [ [ AS ] output_name ] [, ...] ]

To fully study the SQL Select clause, visit its documentation https://www.postgresql.org/docs/current/sql-update.html