Created
March 31, 2012 20:08
-
-
Save bensonk/2268045 to your computer and use it in GitHub Desktop.
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(id), | |
upper + lower + digit as complexity | |
from ( | |
select | |
id | |
,password | |
,CASE WHEN | |
password similar to E'%[A-Z]%' | |
THEN 1 | |
ELSE 0 | |
END as upper | |
,CASE WHEN | |
password similar to E'%[a-z]%' | |
THEN 1 | |
ELSE 0 | |
END as lower | |
,CASE WHEN | |
password similar to E'%[0-9]%' | |
THEN 1 | |
ELSE 0 | |
END as digit | |
,CASE WHEN | |
password similar to E'[~!@#$%^&*()_+-={}\[\]\\;:\'",./<>?`]' | |
THEN 1 | |
ELSE 0 | |
END as symbol | |
from | |
credentials) as calculated_complexity | |
GROUP BY complexity |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment