Received: from ns1.prima.net.id ([202.57.0.8]) by hub.org (8.9.2/8.9.1) with ESMTP id XAA59566 for ; Thu, 11 Mar 1999 23:27:51 -0500 (EST) (envelope-from chairudin@prima.net.id) Received: from prima.net.id (mail.prima.net.id [202.57.0.8]) by ns1.prima.net.id (8.8.4/8.7.2) with ESMTP id SAA23833 for ; Fri, 12 Mar 1999 18:28:41 +0700 (GMT) Sender: root@ns1.prima.net.id Message-ID: <36E8FA69.4CA1832E@prima.net.id> Date: Fri, 12 Mar 1999 04:28:41 -0700 From: Chairudin Sentosa Reply-To: chairudin@prima.net.id Organization: PT. Khasanah Timur Indonesia X-Mailer: Mozilla 4.5 [en] (X11; I; SunOS 5.5.1 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: sum gives different answer Content-Type: multipart/alternative; boundary="------------8024B0AB69593ED70AB5A64F" --------------8024B0AB69593ED70AB5A64F Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi all, I have two SQL statements that I expect to give (0 rows) as output. However the first one with 'sum' does not do that. Why the first SQL statement gives (1 row) and empty? While the second SQL statement can give (0 row). I am using postgresql 6.4.2. First ------ select pin, sum(duration) from tablename where date(start_time)= (select date 'today') group by pin; pin|sum ---+--- | (1 row) Second ------ select pin, duration from tablename where date(start_time)= (select date 'today') group by pin; pin|duration ---+-------- (0 rows) Could anyone tell me why, please? Regards Chai --------------8024B0AB69593ED70AB5A64F Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Hi all,

I have two SQL statements that I expect to give (0 rows) as output.
However the first one with 'sum' does not do that.
Why the first SQL statement gives (1 row) and empty?
While the second SQL statement can give (0 row).
I am using postgresql 6.4.2.

First
------
select pin, sum(duration) from tablename where date(start_time)=
(select date 'today') group by pin;

pin|sum
---+---
   |
(1 row)
 

Second
------
select pin, duration from tablename where date(start_time)=
(select date 'today') group by pin;

pin|duration
---+--------
(0 rows)

Could anyone tell me why, please?

Regards
Chai
 
  --------------8024B0AB69593ED70AB5A64F--