I'm trying to write a simple query with the array function in PostgreSQL, but it doesn't seem to be working properly.
WITH vars AS (
SELECT array['1114156957', '1234'] as npi
)
SELECT CASE
when '1114156957' <> ANY(npi) then 'Not Found'
ELSE 'found'
End as test
FROM vars;
I'm new to Postgres and have never used the array function before. But in the above query shouldn't the result be "Found" since one of values exists in the array?