select A.* from tb_card_bill as A where A.business_order_no not in (select B.out_trade_no from tb_card_order as B where statuses='3' ) AND date_format(a.trans_date, '%Y-%m-%d') = '2020-05-13' and business_name='饭卡充值' ;
本文介绍了一种使用SQL查询特定业务场景下未完成订单的方法,通过对比业务订单表与卡券充值表,筛选出2020年5月13日所有状态为'3'的饭卡充值未关联的业务订单。
select A.* from tb_card_bill as A where A.business_order_no not in (select B.out_trade_no from tb_card_order as B where statuses='3' ) AND date_format(a.trans_date, '%Y-%m-%d') = '2020-05-13' and business_name='饭卡充值' ;
174万+

被折叠的 条评论
为什么被折叠?