no value fetch

Started by BRINER Cedricover 21 years ago3 messagesgeneral
Jump to latest
#1BRINER Cedric
work@infomaniak.ch

hi,

Imagine that I have the following table where ts_sent is a timestamp(0)

select * from notification;
to_used | ts_sent | from
---------------------+-------------------------+---------
amanda@obs.unige.ch | 2004-07-21 14:19:43+02 | amanda
amanda@obs.unige.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 ;
without success...

Anyone has an idea how to do this ?

Thanks in advance !

Cedric BRINER

#2Stephan Szabo
sszabo@megazone23.bigpanda.com
In reply to: BRINER Cedric (#1)
Re: no value fetch

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@obs.unige.ch | 2004-07-21 14:19:43+02 | amanda
amanda@obs.unige.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.

#3Jim Seymour
jseymour@LinxNet.com
In reply to: Stephan Szabo (#2)
Re: no value fetch

Stephan Szabo <sszabo@megazone.bigpanda.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@obs.unige.ch | 2004-07-21 14:19:43+02 | amanda
amanda@obs.unige.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