Re: no value fetch

From: jseymour(at)linxnet(dot)com (Jim Seymour)
To: pgsql-general(at)postgresql(dot)org
Subject: Re: no value fetch
Date: 2004-07-28 11:23:43
Message-ID: 20040728112343.BF8A84311@jimsun.linxnet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com> wrote:
>
>
> On Tue, 27 Jul 2004, BRINER Cedric wrote:
>
> > hi,
> >
> > Imagine that I have the following table where ts_sent is a timestamp(0)
> >
> > select * from notification;
> > to_used | ts_sent | from
> > ---------------------+-------------------------+---------
> > amanda(at)obs(dot)unige(dot)ch | 2004-07-21 14:19:43+02 | amanda
> > amanda(at)obs(dot)unige(dot)ch | | postgres
> >
> > and so, how do I do to fetch the second line by asking :
> > catch me the line where ts_sent doesn't have a value !
> >
> > I've try:
> > select * from notification where ts_sent = null ;
>
> Use ts_sent IS NULL, not ts_sent = null.
>
> Pretty much, <anything> = null returns null.

To expand on this... This is because NULL is nothing. Not zero, but
*nothing*. Being nothing, it cannot "equal" anything. Not even
itself. But a space can *contain* nothing. And it can contain "not
nothing."

Jim

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pierre-Frédéric Caillaud 2004-07-28 11:24:51 Re: Discussion wanted: 'Trigger on Delete' cascade.
Previous Message Pierre-Frédéric Caillaud 2004-07-28 11:19:06 Re: Sql injection attacks