mssql从数据库中随机取出10条发帖数据 并更新其发帖时间
UPDATE (select top 10 * from jb_xs order by newid())
SET btdate = '2013-6-6 0:00:00'
我是这样的 但是提示错误· ·求大神指导错误···
[解决办法]
UPDATE a SET btdate = '2013-6-6 0:00:00'
from jb_xs a
join (select top 10 * from jb_xs order by newid()) b
on a.id=b.id --id为主键