O'Reilly logo

Practical SQL Handbook, The: Using SQL Variants, Fourth Edition by Sandra L. Emerson, Marcy Darnovsky, Judith S. Bowman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Changing Existing Data: UPDATE

While the INSERT statement adds new rows to a table, the UPDATE statement changes existing rows. Use it to change values in single rows, groups of rows, or all the rows in a table.

The UPDATE statement specifies the row or rows you want to change and the new data. The new data can be a constant or expression that you specify, or it can be data pulled from other tables.

Here's a simplified version of the UPDATE syntax for updating specified rows with an expression:

UPDATE table_name
SET column_name = expression
[WHERE search_conditions]

Specifying the Table: UPDATE Clause

The UPDATE keyword is followed by the name of a table or view. As in all the data modification statements, you can change the data in only one ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required