Re: Dates and NULL's`

From: John Fabiani <johnf(at)jfcomputer(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Dates and NULL's`
Date: 2011-05-10 17:24:23
Message-ID: 201105101024.23612.johnf@jfcomputer.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tuesday, May 10, 2011 10:16:21 am Richard Broersma wrote:
> On Tue, May 10, 2011 at 9:48 AM, John Fabiani <johnf(at)jfcomputer(dot)com> wrote:
> > Where mydate >= "2011/04/01"::date and mydate<= "2011/04/30"::date
> > With the above where will the NULL's be selected????
>
> Here is what I get when I try:
>
> spi=> SELECT NULL::DATE >= '2011-04-01'::DATE AND NULL::DATE <=
> '2011-04-30'::DATE;
> ?column?
> ----------
>
> (1 row)
>
>
> spi=> SELECT (NULL::DATE >= '2011-04-01'::DATE AND NULL::DATE <=
> '2011-04-30'::DATE) IS TRUE;
> ?column?
> ----------
> f
> (1 row)
>
>
> spi=> SELECT (NULL::DATE >= '2011-04-01'::DATE AND NULL::DATE <=
> '2011-04-30'::DATE) IS FALSE;
> ?column?
> ----------
> f
> (1 row)
>
>
> spi=> SELECT (NULL::DATE >= '2011-04-01'::DATE AND NULL::DATE <=
> '2011-04-30'::DATE) IS UNKNOWN;
> ?column?
> ----------
> t
> (1 row)
Sorry Richard, I do not understand.

It looks like you are saying the NULLS will be returned too

Johnf

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Broersma 2011-05-10 17:30:58 Re: Dates and NULL's`
Previous Message Richard Broersma 2011-05-10 17:16:21 Re: Dates and NULL's`