Re: [SQL] Check a column value not in Array.

2008-08-15 Thread Emi Lu
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. Thanks a lot for all your in

Re: [SQL] Check a column value not in Array.

2008-08-15 Thread Andreas Wenk
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi everybody, I was reading the mails concerning the subject "Check a column value not in Array" and made a quick test. This is the test table: test=# select * from values; id | item - +- 1 | a

Re: [SQL] Check a column value not in Array.

2008-08-14 Thread Filip RembiaƂkowski
2008/8/14 Emi Lu <[EMAIL PROTECTED]>: > 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 ( ARR

Re: [SQL] Check a column value not in Array.

2008-08-14 Thread Pavel Stehule
Hello 2008/8/14 Emi Lu <[EMAIL PROTECTED]>: > 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']; > > Thanks! postgres=# select 1 = any(ar