时间:2021-07-01 10:21:17 帮助过:17人阅读
更新
WITH IdPhone AS ( SELECT * FROM ( VALUES(‘6205021‘, ‘13680011913‘), (‘4401061‘, ‘13680000972‘), (‘3729281‘, ‘13680011766‘), (‘1310221‘, ‘13680001061‘), (‘4128251‘, ‘13680015512‘), (‘3706251‘, ‘13680005269‘), (‘5102121‘, ‘13680017619‘), (‘4412831‘, ‘13680017760‘), (‘4209821‘, ‘13680013534‘), (‘4413231‘, ‘13680009467‘) ) AS v(Id, Phone) ) --SELECT DISTINCT u.Id--,v.Phone UPDATE u SET u.StaffId = v.Phone FROM dbo.Users AS u WITH(NOLOCK) INNER JOIN IdPhone AS v ON v.Id = u.IDNumber ;
T-SQL 批量更新字段
标签:http update tin lock src 图片 mamicode span user