[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [GENERAL] date null
From:       Ulf Mehlig <umehlig () uni-bremen ! de>
Date:       1998-10-26 8:58:52
[Download RAW message or body]

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
  ~~~~~~~~~~~~~~~~~~~~

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic