#标記不參與計算的明細(跨平台的或is_end=2)
#跨平台訂單:暫不處理
說明:大表即order_list_wx,幾十萬,需要根據小表(order_list_zfb ,幾萬)來做更新,查出兩個平台都有訂單号(因為程式BUG所導緻的)。
@Run.ExecuteSql("标記跨平台訂單",@"
update bi_data.order_list_wx a
set is_end='2'
where exists (select 1 from bi_data.order_list_zfb b where a.商戶訂單号=b.商戶訂單号)
and is_end='0'
")
join bi_data.order_list_zfb b on a.商戶訂單号=b.商戶訂單号
set a.is_end='2'
where a.is_end='0'
本文來自部落格園,作者:xiaoyongdata(微信号:xiaoyongdata),轉載請注明原文連結:https://www.cnblogs.com/xiaoyongdata/p/15717952.html