Created
August 26, 2016 10:48
-
-
Save atopal/af1dbc087b31e5837f38b27fa3a9d76a to your computer and use it in GitHub Desktop.
active accounts with Persona but not github credentials
This file contains hidden or 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 DISTINCT `auth_user`.`email`, `auth_user`.`first_name`, `auth_user`.`last_name` | |
FROM | |
(SELECT * | |
FROM `socialaccount_socialaccount` | |
WHERE `socialaccount_socialaccount`.`provider`="persona") A | |
LEFT JOIN | |
(SELECT * | |
FROM `socialaccount_socialaccount` | |
WHERE `socialaccount_socialaccount`.`provider`="github") B | |
ON A.`user_id` = B.`user_id` | |
JOIN `auth_user` ON `auth_user`.`id` = A.`user_id` | |
WHERE B.`user_id` IS NULL | |
AND `auth_user`.`is_active` = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment