English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The SET command is used with UPDATE to specify which columns and values should be updated in the table.
The following SQL uses a new contact name and a new city to update the first customer (CustomerID = 1) :
UPDATE Customers SET ContactName = 'Alfred Schmidt', City = 'Frankfurt' WHERE CustomerID = 1;
For the 'Country/All records with the region 'Mexico' will have the field 'ContactName' updated to 'Juan':
UPDATE Customers SET ContactName='Juan'; WHERE Country='Mexico';
Note:Be careful when updating records in the table! Pay special attention to the UPDATE statement inWHERE clause. The WHERE clause specifies the records to be updated.If the WHERE clause is omitted, all records in the table will be updated!