1 /*Update 语句 2 3 Update 语句用于修改表中的数据 4 5 UPDATE 表名称 SET 列名称 = 新值 WHERE 列名称 = 某值 6 7 UPDATE 表别名 SET 列名称 = 新值 FROM 表名称 表别名 WHERE 列名称 = 某值*/ 8 9 USE AdventureWorks2008R2 10 SELECT * FROM Person.Address 11 12 SELECT * FROM Person.Address where AddressID=527 13 UPDATE Person.Address SET AddressLine2='test1' where AddressID=527 14 --UPDATE别名错误写法 15 UPDATE Person.Address AS T1 SET T1.AddressLine2='test1' where AddressID=527 16 --UPDATE别名正确写法 17 update t set AddressLine2 ='test2' from Person.Address t where AddressID = 527 18 19 /*--常规写法 20 UPDATE Person SET FirstName = 'Fred' WHERE LastName = 'Wilson' 21 UPDATE Person SET Address = 'Zhongshan 23', City = 'Nanjing' 22 WHERE LastName = 'Wilson' 23 */