You want AND
, not OR
:
where lower(person) not like '%b%' and
lower(person) not like '%c%' and
lower(person) not like '%e%' and
lower(person) not like '%f%'
This is logically equivalent to:
where not (lower(person) like '%b%' or
lower(person) not like '%c%' or
lower(person) not like '%e%' or
lower(person) not like '%f%'
)
Or more concisely:
where not regexp_contains(person, '[BbCcEeFf]')
Or if you want to be a bit inscrutable:
where not regexp_contains(person, '(?i)[bcef]')
The (?i)
makes the pattern matching case-insensitive.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…