时间:2021-07-01 10:21:17 帮助过:7人阅读
下面是用not in 实现的 ,需要修改为 exists实现
SELECT COUNT(*) from order_info_ref as oif where oif.order_time>='2016-03-02 00:01:00' and oif.order_time<='2016-03-02 23:59:59' and oif.ca_user_id NOT in
(SELECT oi.ca_user_id from order_info_ref as oi where oi.order_time>='2016-03-01 00:01:00' and oi.order_time<='2016-03-01 23:59:59');