34,590
社区成员
发帖
与我相关
我的任务
分享
;with cte as
(
select
a.is_del
from ST_person a
inner join ST_card b
on a.person_id = b.person_id
and b.Card_ValidDate < getdate()
)
update cte
set is_del = '1'
update a set a.is_del ='1'
from ST_person a,ST_card b
where a.person_id=b.person_id
and b.Card_ValidDate<getdate()
update a
set is_del ='1'
from ST_person a join ST_card b on a.person_id = b.person_id
where b.Card_ValidDate<getdate()