篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql Cancelaciones sin pago pendiente相关的知识,希望对你有一定的参考价值。
SELECT app1.car_id, app1.appointment_id FROM pending_payment as pp1 join appointment as app1 on app1.appointment_id = pp1.appointment_id join slave_card_charge as scc on pp1.appointment_id = scc.appointment_id WHERE pp1.status = 1 AND app1.status in (4,5) AND scc.created_date >= '2019-06-03' and scc.created_date<'2019-06-10 00:00:00' AND scc.captured = 'true'
SELECT app.car_id, app.appointment_id FROM appointment as app WHERE app.created_dt >= '2019-06-03' and app.created_dt<'2019-06-10 00:00:00' AND app.amount > 0 AND (app.status in (4,5) AND NOT EXISTS( SELECT pp.appointment_id FROM pending_payment as pp WHERE pp.appointment_id = app.appointment_id))
以上是关于sql Cancelaciones sin pago pendiente的主要内容,如果未能解决你的问题,请参考以下文章