0

我想说的是:“如果 RC.Expiration 大于或等于今天的日期并且 RC.DemoLicense 等于 0,则将 DemoTracking.Purchased 设置为 1”我只需要查看 DT.Purchased 为 0 的条目.

update WebCatalog.Published.DemoTracking
set Purchased = 1
from WebCatalog.Published.RCompany RC
inner join WebCatalog.Published.DemoTracking DT
    on RC.Link = DT.RCompanyLink and DT.Purchased = 0
where RC.Expiration >= GETDATE() and RC.DemoLicense = 0
4

1 回答 1

0

try this

update WebCatalog.Published.DemoTracking
set Purchased = 1
where Purchased = 0 and RCompanyLink in (select Link as RCompanyLink from WebCatalog.Published.RCompany where RC.Expiration >= GETDATE() and RC.DemoLicense = 0)
于 2013-10-22T19:54:25.217 回答