---

Five Handy Tips for MySQL’s Powerful UPDATE Statement

“Rob Gravelle explores the MySQL UPDATE statement, which is used
to modify existing records in a table. Among its many features, he
looks at how to update multiple tables, avoiding mistakes, and how
to limit how many rows are updated.

“In the MySQL INSERT Statement Variations article, we explored
the use of MySQL INSERT…SELECT syntax and other ways to construct
an effective INSERT statement. Today we will be shifting our focus
to the UPDATE statement, which is used to modify existing records
in a table. Among its many features, we’ll be looking at how to
update multiple tables, avoiding mistakes, and how to limit how
many rows are updated.

“Basic Syntax

“Here is the basic syntax of the UPDATE statement that we
learned in the “MySQL INSERT Statement Variations” article:

UPDATE table_name
SET column1=value, 
    column2=value2,
...
WHERE some_column=some_value


Complete Story

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis