Search the Whole World Here.,.,

SQL - UPDATE Multiple Records

SQL - UPDATE Multiple Records


In an update statement, it is the WHERE clause that determines how many records which will be updated.

The WHERE clause: WHERE Country='Mexico' will update all records which have the value "Mexico" in the field "Country".

Example

UPDATE Customers
SET ContactName='Juan'
WHERE Country='Mexico';
Try it Yourself »

SQL - UPDATE Multiple Columns

SQL - UPDATE Multiple Columns


To update more than one column, use a comma as seperator.

Assume we wish to update the customer "Alfreds Futterkiste" with a new contact person and city.

We use the following SQL statement:

Example

UPDATE Customers
SET ContactName='Alfred Schmidt', City='Frankfurt'
WHERE CustomerID=1;
Try it Yourself »

Ads by Google