Last active
November 17, 2020 07:30
-
-
Save MostafaNorzade/0bad1a78a36cab249a4c2b5de4824614 to your computer and use it in GitHub Desktop.
get_user_mobile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT users.mobile FROM users | |
WHERE users.mobile NOT IN ( | |
SELECT users.mobile FROM subscriptions | |
INNER JOIN users ON subscriptions.user_id = users.id | |
WHERE subscriptions.type IN (1,2) AND | |
subscriptions.status = 2 AND | |
users.mobile IS NOT NULL | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment