From: | Marcus Engene <mengpg(at)engene(dot)se> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: IN clause |
Date: | 2006-11-24 15:04:54 |
Message-ID: | 45670A16.9040508@engene.se |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I see we have a C J Date fan on the list! ;-)
There is one other case where I personally find nullable
columns a good thing: process_me ish flags. When a row
is not supposed to be processed that field is null and
when a field is null it wont be in the index [at least
on Oracle].
Best regards,
Marcus
Brandon Aiken skrev:
> 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(at)postgresql(dot)org
> [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Martijn van
> Oosterhout
> Sent: Friday, November 24, 2006 7:20 AM
> To: surabhi.ahuja
> Cc: A. Kretschmer; pgsql-general(at)postgresql(dot)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,
From | Date | Subject | |
---|---|---|---|
Next Message | Brandon Aiken | 2006-11-24 16:14:25 | Re: indexes |
Previous Message | Tom Allison | 2006-11-24 14:54:27 | indexes |