Advertisement
festinko

Untitled

Dec 13th, 2022
717
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.37 KB | None | 0 0
  1. SELECT
  2.   DATE_TRUNC(DATETIME(paymentDateTime), DAY) paymentYearMonthDay,
  3.   COUNT (DISTINCT userID) usersWithRenewalSubsPaymentCount
  4.  
  5. FROM
  6.   `uptimerobot-001.ur.payments`
  7.  
  8. WHERE
  9.   paymentNewUpgradeRenewal = 3
  10.   AND paymentPeriod IN (1,12)
  11.   AND paymentStatus = 1
  12.   AND userID IS NOT NULL
  13.  
  14. GROUP BY
  15.   paymentYearMonthDay
  16.  
  17. ORDER BY
  18.   paymentYearMonthDay DESC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement