Update (SQL)

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.

In some databases, such as PostgreSQL, when a FROM clause is present, what essentially happens is that the target table is joined to the tables mentioned in the fromlist, and each output row of the join represents an update operation for the target table.

[2] Because of this indeterminacy, referencing other tables only within sub-selects is safer, though often harder to read and slower than using a join.

One may also update multiple columns in a single update statement: Complex conditions and JOINs are also possible: Some databases allow the non-standard use of the FROM clause: Or on Oracle systems (assuming there is an index on classification.articleID): With long name of table: