I have a column that its value is set from enum.
I would like to check if there are lines that mistakely were set to a value nor from the enum, grouped by their value.
The following queries retrive the same results:
Using HAVING
select COLUMN1, COUNT(*) as cntr
from TABLE1
group by COLUMN1
having COLUMN1 not in ('enum_value_1', 'enum_value_2')
Using WHERE
select COLUMN1, COUNT(*) as cntr
from TABLE1
where COLUMN1 not in ('enum_value_1', 'enum_value_2')
group by COLUMN1
What should I use?