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
标签:status,pay,time,jion,mysql,NULL,id,SELECT,left 来源: https://www.cnblogs.com/xzhlch/p/14312369.html