Advertisement
festinko

Untitled

Oct 10th, 2022
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.38 KB | None | 0 0
  1. SELECT
  2. userID,
  3. paymentDateTime,
  4. paymentAmount,
  5. paymentPeriod,
  6. DATE_ADD(DATETIME(paymentDateTime), INTERVAL paymentPeriod MONTH) expirationDateTime
  7.  
  8. FROM
  9. `uptimerobot-001.ur.payments`
  10.  
  11. WHERE
  12.   paymentPeriod = 12
  13.   AND paymentStatus = 1
  14.   AND DATE_ADD(DATE(paymentDateTime), INTERVAL paymentPeriod MONTH) BETWEEN '2022-11-01' AND '2022-12-31'
  15.  
  16. ORDER BY
  17.   expirationDateTime DESC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement