sql>select * from t;
PASSWORD
------------------------------
ABCDEF
123456
ABC123
123ABC
4 rows selected.
sql>select password
2 from t
3 where not ( length(password) = length(replace(translate(password, '0123456789', '0'), '0'))
4 or lower(password) = upper(password));
PASSWORD
------------------------------
ABC123
123ABC
2 rows selected.
sql>select password
2 from t
3 where ( length(password) = length(replace(translate(password, '0123456789', '0'), '0'))
4 or lower(password) = upper(password));
PASSWORD
------------------------------
ABCDEF
123456
2 rows selected.