Received: from ns1.prima.net.id ([202.57.0.8]) by hub.org (8.9.2/8.9.1) with ESMTP id AAA64819 for ; Fri, 12 Mar 1999 00:23:18 -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 TAA24563 for ; Fri, 12 Mar 1999 19:24:12 +0700 (GMT) Sender: root@ns1.prima.net.id Message-ID: <36E9076C.2850C00@prima.net.id> Date: Fri, 12 Mar 1999 05:24:12 -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: 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