You are here: Reference Information > SQL Reference Information > SQL Statements > UPDATE

UPDATE

UPDATE — Update rows of a table

Syntax

UPDATE [schema.]table_name
   SET column_name = expression [ , column_name = expression , ... ]
[ WHERE condition ]

Syntax using JOIN

Also see Example 5: Update a table using JOIN.

UPDATE [schema.]table_name 
   SET column_name = expression [ , column_name = expression , ... ]
[ WHERE condition ]
       [<join-specification>]

Description

The UPDATE statement is used to change rows in a table. The SET clause contains the list of columns in the table that will be updated by the UPDATE statement. Any number of columns in the table can be updated. Columns in the table that are not listed will retain their existing value, unless the values of the non listed columns are modified by a trigger.

The WHERE clause specifies the condition for which rows in the table will be updated by the UPDATE statement. This condition can be in the form of a value expression that returns a value of type boolean, where a true result is returned for each row selected, or in the form of a valid subquery SELECT. Refer to the SELECT statement for a further description of a valid subquery.

Note:

The user:

Parameters

Examples