This is the code I am running in postgres:
SELECT CASE WHEN 'oz' != ANY(('{oz,l,m,g}')::text()) THEN 'HELOO' ELSE 'WOAH' END;
AFAIK, this should select ‘WOAH’ but it gives ‘HELOO’. Now, with any string on the left side, it always selects ‘HELOO’ (I have tried ‘monkey’, and ‘mg’).
When I run the same code but now without a !
:
SELECT CASE WHEN 'oz' = ANY(('{oz,l,m,g}')::text()) THEN 'HELOO' ELSE 'WOAH' END;
It works as intended i.e. it selects ‘HELOO’ and when the left side string is ‘monkey’, it selects ‘WOAH’.
How can I check here if the left side string is NOT in the right side text()?