pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John Fabiani <johnf@jfcomputer.com>
To: pgsql-sql@postgresql.org
Subject: Re: Dates and NULL's`
Date: Tue, 10 May 2011 10:24:23 -0700
Message-ID: <201105101024.23612.johnf@jfcomputer.com> (raw)
In-Reply-To: <BANLkTina8jK3f_p0xynxgzQhpL2aCUsL6A@mail.gmail.com>
References: <201105100948.41392.johnf@jfcomputer.com>
	<BANLkTina8jK3f_p0xynxgzQhpL2aCUsL6A@mail.gmail.com>

On Tuesday, May 10, 2011 10:16:21 am Richard Broersma wrote:
> On Tue, May 10, 2011 at 9:48 AM, John Fabiani <johnf@jfcomputer.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



view thread (10+ messages)  latest in thread

Message-ID: <201105101024.23612.johnf@jfcomputer.com>
Permalink:  ../201105101024.23612.johnf@jfcomputer.com/
Also on:    postgresql.org/message-id/201105101024.23612.johnf@jfcomputer.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: johnf@jfcomputer.com
  Subject: Re: Dates and NULL's`
  In-Reply-To: <201105101024.23612.johnf@jfcomputer.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox