September 12th, 2008
UPDATE Syntax
Posted by
admin in
E. INSERT, UPDATE, DELETE
UPDATE does not add or delete rows, it only updates row data.
UPDATE without a WHERE clause will update all rows.
For this reason, you must be careful when doing an update.
The WHERE clause specifies the rows to be updated.
UPDATE table
SET column1 = [value,
| hostvariable,
| expression,
| NULL,
| specialregister,]
[column2 = [value, ...
| hostvariable, ...
| expression, ...
| NULL, ...
| specialregister, ...]]
[WHERE conditions];
> The SET value or expression must match the data type of the column and
replaces the existing value in that column.
> An expression can not cause an arithmetic error such as divide by zero.
> A value can not violate a CHECK constraint or a FOREIGN KEY constraint.
Â