例如一个表中有100条记录,我要任意选择其中的20条进行修改,sql语句如何写?
set rowcount 20
update 表 set...
set nocount on
update 表
set ...
from (select top 20 ID from 表 order by newid()) k
where 表.ID = k.ID
或
update 表
set ...
where ID in (select top 20 ID from 表 order by newid())