Fun in the Transact-SQL documentation
Aug. 26th, 2004 10:39 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
The WHERE clause specifies the rows to update. For example, consider the unlikely event that northern California is renamed Pacifica (abbreviated PC) and the people of Oakland vote to change the name of their city to Bay City. This example shows how to update the authors table for all former Oakland residents whose addresses are now out of date.
UPDATE authors
SET state = 'PC', city = 'Bay City'
WHERE state = 'CA' AND city = 'Oakland'
You must write another statement to change the name of the state for residents of other northern California cities.
UPDATE authors
SET state = 'PC', city = 'Bay City'
WHERE state = 'CA' AND city = 'Oakland'
You must write another statement to change the name of the state for residents of other northern California cities.
no subject
Date: 2004-08-26 09:02 am (UTC)