标签:http update tin lock src 图片 mamicode span user
;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 * FROM IdPhone;
更新
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 ;
标签:http update tin lock src 图片 mamicode span user
原文地址:https://www.cnblogs.com/Jolinson/p/11215399.html