null answer - how? - Mailing list pgsql-general

From Patrick Welche
Subject null answer - how?
Date
Msg-id 20010919181700.Q4398@quartz.newn.cam.ac.uk
Whole thread Raw
Responses Re: null answer - how?
List pgsql-general
select coalesce(sum(deltafromoctets),0)
  from trans,stats
 where stats_id=stats.id
   and (timeslicet < '1:05' OR timeslicet > '6:05')

returns a number (9188191930), whereas

select coalesce(sum(deltafromoctets),0)
  from trans,stats
 where stats_id=stats.id
   and (timeslicet < '1:05' OR timeslicet > '6:05')
   and timesliced < '01-May-2001'

prints 0 (or null without the coalesce) as does

select coalesce(sum(deltafromoctets),0)
  from trans,stats
 where stats_id=stats.id
   and timesliced < '01-May-2001'

How can this be?

select * from stats where timesliced is null or timeslicet is null
select * from trans where deltafromoctets is null

both retun 0 rows.

stats_id and stats.id are "not null"
timesliced date, timeslicet time, deltrafromoctets bigint.

Any hints?

Cheers,

Patrick

pgsql-general by date:

Previous
From: Arne Weiner
Date:
Subject: Re: Why, why, why
Next
From: Denis Perchine
Date:
Subject: Re: Recreating indices safely