into #临时表的用法
#DDD 只针对当前打开窗口或者存储过程有效 在存储过程中 执行完自动删除临时表
select b.TransactionID into #DDD from tb_test as a
inner join tb_order as b on a.TransactionID=b.TransactionID
where a.Status in('Uncleared','Under Review','Held') and b.InTime>GETDATE()-4
update tb_order set OrderRiskTypeID=1
from #DDD as hh
where hh.TransactionID=tb_order.TransactionID and Auditing=0 and InTime >GETDATE()-4

浙公网安备 33010602011771号