UPDATE


Use this statement to update one or more data rows in an existing table. Its syntax is:
 UPDATE table SET field = newvalue [WHERE wherepredicate]

The parts of this statement have the following meaning:
Part Meaning
table The table to be updated
field The field to be updated
newvalue An expression that is data compatible with field
wherepredicate A predicate limiting the data to be updated.

NOTE:

  1. If you do not give a WHERE clause, then the update is global, i.e. The field changes to newvalue in every row.
  2. If newvalue is an expression then that expression takes its values from the data row to be updated, e.g.
      UPDATE Prices SET Cost = Cost * 1.25 WHERE ProductType = "Cereal"


[Return to SQL Syntax]