Any comparison to NULL, with the exception of is null
and is not null
, returns NULL which is interpreted as false for boolean purposes. This is standard behavior for all databaes.
If you want to do a comparison within a set of values, here are two options:
where coalesce(produit_id, -1) not in (-1, . . . .)
This assumes that -1 is an invalid value for the id. Or, you can do an explicit comparison:
where produit_id is not null and produit_id not in ( . . . )