Created
June 8, 2018 09:47
-
-
Save championswimmer/2ceb824172fba7807c84ccf1dcc8bce0 to your computer and use it in GitHub Desktop.
all users with one verified and multiple unverified accounts
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 | |
count("email") AS "count", | |
count("verifiedemail") as "Verified", | |
max("createdAt") as "Last Attempt", | |
min("createdAt") as "First Attempt", | |
"public"."users"."email" AS "email" | |
FROM "public"."users" | |
GROUP BY "public"."users"."email" | |
HAVING | |
count("email") > 1 AND | |
count("verifiedemail") = 1 | |
ORDER BY "count" DESC, "public"."users"."email" ASC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment