Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- paymentDateTime,
- userID,
- paymentPeriod
- FROM
- payments
- WHERE
- DATE_ADD(paymentDateTime, INTERVAL paymentPeriod MONTH) > '2022-01-01 00:00:01' AND
- DATE_ADD(paymentDateTime, INTERVAL paymentPeriod MONTH) < '2022-01-31 23:59:59'
- AND paymentStatus = 1
- AND paymentPeriod > 0
- AND userID IS NOT NULL;
- GROUP BY
- paymentPeriod
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement