mysql left jion 一个结果集

SELECT
'111' 产品,
a.pay_time,c.pay_time
FROM
customer_bill_pay_log AS a
LEFT JOIN (
SELECT
id,
pay_time
FROM
customer_bill_pay_log as b
WHERE
pay_status = 2
AND use_status = 1
AND pay_time IS NOT NULL
AND from_unixtime( pay_time, '%Y-%m' ) = '2020-12'
) AS c ON a.id = c.id
WHERE
a.pay_status = 2
AND a.use_status = 1
AND a.pay_time BETWEEN '1606752000'
AND '1609430400'
and c.pay_time is NULL

上一篇:npm i tenpay 卡主,下不动怎么办?


下一篇:luffy-16/订单表设计,立即付款接口/前端,支付成功get回调用户展示,支付成功post回调修改订单状态