Re: Check a column value not in Array. - Mailing list pgsql-sql

From Filip Rembiałkowski
Subject Re: Check a column value not in Array.
Date
Msg-id 92869e660808141231h73810e9ek93e79fd68547ee8b@mail.gmail.com
Whole thread Raw
In response to Check a column value not in Array.  (Emi Lu <emilu@encs.concordia.ca>)
Responses Re: Check a column value not in Array.
Re: Check a column value not in Array.
List pgsql-sql
2008/8/14 Emi Lu <emilu@encs.concordia.ca>:
> Greetings,
>
> May I know the command to check whether a column value is in array please?
>
> For example, I am looking  for sth like:
>
> select *
> from   test
> where  test.col not in ARRAY['val1', 'val2'];
>

select * from test where test.col <> ALL ( ARRAY['val1', 'val2'] );

see http://www.postgresql.org/docs/current/static/functions-comparisons.html

be careful with NULLs in this type of comparisons.


--
Filip Rembiałkowski

pgsql-sql by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: Check a column value not in Array.
Next
From: Andreas Wenk
Date:
Subject: Re: Check a column value not in Array.