When I send query like
SELECT id FROM private_messages WHERE to_id=1 AND opened=0
It doesn’t return anything
SELECT id FROM private_messages WHERE to_id=1 AND opened<>1
Returns all results where opened=0. opened columns type is enum with “1” and “0” (default) values. Question is, why first query doesn’t return anything?
Since
openedis an enum, you should write:Enums are really just a set of possible strings. From the documentation: