Other times, you may want to change certain rows based on the value of a particular column. The SET clause specifies the columns to update and their new values, and the WHERE clause specifies the rows to update.
For example, if the telephone area code changed from ‘508’ to ‘978’, you could change every row with the old area code to the new area code with the following command:
UPDATE customer SET LEFT(phone,3) = ‘978’ WHERE LEFT (phone, 3) = ‘508’