Advertisement
festinko

Untitled

Sep 14th, 2022
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.39 KB | None | 0 0
  1. SELECT
  2. userID,
  3. userEmail,
  4. userNewsletter,
  5. userSMSRefill
  6.  
  7.  
  8. FROM
  9.     users
  10.    
  11. WHERE userID IN (
  12.  
  13.             SELECT
  14.              userID
  15.             FROM
  16.                 alertcontacts
  17.                
  18.             WHERE
  19.                 alertContactType IN (8,14)
  20.                 AND alertContactStatus = 2
  21.                
  22.             GROUP BY
  23.                     userID
  24.             ORDER BY
  25.                 userID)
  26.     AND (userSMSRefill = 0  OR userSMSRefill IS NULL)
  27.    
  28. ORDER BY
  29.     userNewsletter,
  30.     userSMSRefill
  31.                
  32.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement