Re: IN clause

Поиск
Список
Период
Сортировка
Искать
От
Brandon Aiken
Тема
Re: IN clause
Дата
Msg-id
F8E84F0F56445B4CB39E019EF67DACBA3C4BFA@exchsrvr.winemantech.com
Ответ на
Re: IN clause (Martijn van Oosterhout)
Список
Дерево обсуждения
Re: IN clause "surabhi.ahuja" <surabhi.ahuja@iiitb.ac.in>
Re: IN clause Martijn van Oosterhout <kleptog@svana.org>
Re: IN clause "Brandon Aiken" <BAiken@winemantech.com>
Re: IN clause Marcus Engene <mengpg@engene.se>
Re: IN clause Jim Nasby <decibel@decibel.org>
Re: IN clause Martijn van Oosterhout <kleptog@svana.org>
Re: IN clause Alban Hertroys <alban@magproductions.nl>
Re: IN clause Richard Broersma Jr <rabroersma@yahoo.com>
Re: IN clause Ragnar <gnari@hive.is>
Re: IN clause Richard Broersma Jr <rabroersma@yahoo.com>
Hasn't it been said enough?  Don't allow NULLs in your database.
Databases are for storing data, not a lack of it.  The only time NULL
should appear is during outer joins.

--
Brandon Aiken
CS/IT Systems Engineer
-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Martijn van
Oosterhout
Sent: Friday, November 24, 2006 7:20 AM
To: surabhi.ahuja
Cc: A. Kretschmer; pgsql-general@postgresql.org
Subject: Re: [GENERAL] IN clause

On Fri, Nov 24, 2006 at 05:31:07PM +0530, surabhi.ahuja wrote:
> That is fine 
> but what I was actually expecting is this
> if 
> select * from table where col_name in (null, 'a', 'b');
> 
> to return those rows where col_name is null or if it = a or if it is =
b
>  
> But i think in does not not support null queries , am i right?

You'll need to check the standard, but IN() treats NULL specially, I
think it returns NULL if any of the elements is null, or something like
that. It certainly doesn't work the way you think it does.

Have a nice day,
-- 
Martijn van Oosterhout      http://svana.org/kleptog/
> From each according to his ability. To each according to his ability
to litigate.
В списке pgsql-general по дате отправления
От: William Leite Araújo
Дата:
От: Marcus Engene
Дата:
Сообщение: Re: IN clause
FAQ