1
我创建了以下性能不佳的更新。我觉得可能有更容易或更有效的方式来进行查询,而不是我的蛮力尝试。请帮忙。使用子查询进行TSQL更新
Update LocalServers
set MustIPL = 1
where LocalServerID IN (SELECT distinct olu.LocationID
from OfferLocUpdate olu with (NoLock)
Join LocalServers ls WITH (NOLOCK) on olu.LocationID = ls.LocationID
Join CPE_IncentiveDLBuffer DLB with (NoLock) on olu.OfferID = dlb.OfferID
where
olu.LastSent > IncentiveLastHeard
and CreationDate < dateadd(d, [email protected], getdate())
and DLB.FileName LIKE '%IDL-A')