pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Emi Lu <emilu@encs.concordia.ca>
To: John Fabiani <johnf@jfcomputer.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Dates and NULL's`
Date: Tue, 10 May 2011 16:16:34 -0400
Message-ID: <4DC99D22.5000004@encs.concordia.ca> (raw)
In-Reply-To: <201105100948.41392.johnf@jfcomputer.com>
References: <201105100948.41392.johnf@jfcomputer.com>

> if I have a date field that contains a NULL
> will it show up when I ask for a where date range for the same date field.
>
> Where mydate>= "2011/04/01"::date and mydate<= "2011/04/30"::date
>
> With the above where will the NULL's be selected????
>
> I ask because I was always told that a NULL matches everything and nothing!


I think the answer is no.

when mydate is null, record will not be returned.

e.g.,
select 'abc' where (null::date >='2011-01-01'::date) ;

0 rows returned.

Emi




view thread (10+ messages)  latest in thread

Message-ID: <4DC99D22.5000004@encs.concordia.ca>
Permalink:  ../4DC99D22.5000004@encs.concordia.ca/
Also on:    postgresql.org/message-id/4DC99D22.5000004@encs.concordia.ca

 · 

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: emilu@encs.concordia.ca, johnf@jfcomputer.com
  Subject: Re: Dates and NULL's`
  In-Reply-To: <4DC99D22.5000004@encs.concordia.ca>

* 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