Re: [GENERAL] date null - Mailing list pgsql-general

From Ulf Mehlig
Subject Re: [GENERAL] date null
Date
Msg-id 199810260858.JAA02279@uni-bremen.de
Whole thread Raw
In response to date null  (ZioBudda <michel@michel.enter.it>)
List pgsql-general
Morelli 'ZioBudda' Davide Michel wrote:

> Hi, how can control in a "select" if a date is not null? [...]  I
> want to select only tuples in which notifica1 or notifica2 or
> notifica3 are not null.

did you try the following?

    select *
    from prestito
    where notifica1 is not null or
          notifica2 is not null or
          notifica3 is not null


The type of the column shouldn't matter, should it? And watch out,
there is a difference between "something = 0"and "something is null"
with something beeing some numeric type (float, int etc.): The first
says that the value of "something" in that row is zero, the second,
that there isn't any value assigned to "something"in that row. With
value zero you can do calculations (some! ;-), with "null", you
can't.

Ulf

--
======================================================================
 %%%%%            Ulf Mehlig              <ulf.mehlig@uni-bremen.de>
   %%%%!%%%       Projekt "MADAM"         <umehlig@uni-bremen.de>
%%%% %!% %%%%     ----------------------------------------------------
 ---| %%%         MADAM:  MAngrove    |  Center for Tropical Marine
    ||--%!%              Dynamics     |  Biology
    ||                  And           |  Fahrenheitstrasse 1
 _ /||\_/\_            Management     |
/  /    \  \ ~~~~~~~~~~~~~~~~~        |  28359 Bremen/Germany
  ~~~~~~~~~~~~~~~~~~~~

pgsql-general by date:

Previous
From: ulrich@strategic.co.za
Date:
Subject: tm
Next
From: Ulf Mehlig
Date:
Subject: Re: [GENERAL] select and join