Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Users with payment for SMS / call notification credits & not active SMS / call alert contact*/
- SELECT
- p.userID,
- u.userEmail,
- userNewsletter,
- userSMSRefill
- FROM
- payments p
- LEFT JOIN
- users u
- ON p.userID = u.userID
- WHERE
- paymentPeriod = 0
- AND (userSMSRefill = 0 OR userSMSRefill IS NULL)
- AND u.userID IS NOT NULL
- AND p.userID NOT IN (
- /*Users with active SMS / Voice call alert contact*/
- SELECT
- userID
- FROM
- alertcontacts
- WHERE
- alertContactType IN (8,14)
- AND alertContactStatus = 2
- GROUP BY
- userID
- )
- GROUP BY
- p.userID
- ORDER BY
- userNewsletter,
- userSMSRefill
Add Comment
Please, Sign In to add comment