我有一个废弃的购物车查询,以便创建一个邮寄列表。我不想做的一件事是向任何在放弃购物车日期后下订单的人发送电子邮件,我将如何将其添加到以下内容:
select *
from cart
where order_status = ''
and date_ordered = '0000-00-00'
and customer_email IS NOT NULL
and date_added > subdate(current_date, 1)
and date_added < current_date
and brand Is Not Null
and customer_email != ' '
group by customer
order by date_added desc;
所以现在我想排除在同一天的订单中存在客户 ID 的记录。以免在他们下订单后第二天给他们发电子邮件。
提前致谢。