Skip to main content

UPDATE

Update rows in a table.

{{< codeheader "Syntax" expand >}}

UPDATE <table_name> [AS alias]
SET <column1_name> = <value1> [, <column2_name> = <value2> ... ]
[ WHERE where_conditions ]

Parameters

{{< sql-section file="data/sql/tables.json" data="updating" >}}

note:

Join conditions are not supported in WHERE clauses. If you need to use a join condition, use a MERGE statement.

Example unsupported UPDATE command
update t2 set id = id + t1.id from t1 where t1.name = t2.name;
Equivalent MERGE command
merge into t2 using t1 on (t1.name = t2.name) when matched then update set id = t2.id + t1.id;