Re: Check a column value not in Array.

Поиск
Список
Период
Сортировка
От Emi Lu
Тема Re: Check a column value not in Array.
Дата
Msg-id 48A58570.4080307@encs.concordia.ca
обсуждение исходный текст
Ответ на Re: Check a column value not in Array.  ("Filip Rembiałkowski" <plk.zuber@gmail.com>)
Список pgsql-sql
>> 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 inputs!



For efficiency, I guess :

(1) "... where test.col <> all ARRAY['val1', 'val2']"
and
(2) "... where test.col not in ('var1', 'var2')"

provide the same query efficiency right?








В списке pgsql-sql по дате отправления:

Предыдущее
От: Andreas Wenk
Дата:
Сообщение: Re: Check a column value not in Array.
Следующее
От: "Edward W. Rouse"
Дата:
Сообщение: Join question