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) AND date_format(a.trans_date, '%Y-%m-%d') = '2020-05-13' and business_name='饭卡充值' ;
本文深入探讨了使用SQL进行复杂查询的技术,特别是如何通过子查询和条件筛选来精确获取特定业务场景下的数据,如未匹配的订单记录。通过具体案例,如从账单表中找出在指定日期未被任何订单关联的饭卡充值记录,读者将学会如何运用SQL语法解决实际问题。
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) AND date_format(a.trans_date, '%Y-%m-%d') = '2020-05-13' and business_name='饭卡充值' ;
174万+

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