阅读背景:

SQL Update TOP 、Update Order by 和output的使用

来源:互联网 
update top(1) Products with(updlock,readpast)
set Status = 1
output Deleted.Id as PoolSkuId
from 
(select top 1 Id from Products 
where Deleted = 0 and Status = 0 order by createdTime desc) t1
where Products.Id = t1.Id
update top(1) Products with(updlock,readpast



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: