An SQL UPDATE statement changes the data of one or more records in a table. Either all the rows can be updated, or a subset may be chosen using a condition.
The
UPDATE
statement has the following form:UPDATE
table_name SET
column_name = value [, column_name = value ...] [WHERE
condition]For the
UPDATE
to be successful, the user must have data manipulation privileges (UPDATE
privilege) on the table or column, the updated value must not conflict with all the applicable constraints (such as primary keys, unique indexes, CHECK
constraints, and NOT NULL
constraints).