X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 08E8F9FA2EA for ; Thu, 10 Aug 2006 20:31:19 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 53807-01 for ; Thu, 10 Aug 2006 23:31:15 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 9FBEF9F9858 for ; Thu, 10 Aug 2006 20:31:15 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from alimail.net (potatis.alimail.net [84.19.131.11]) by svr4.postgresql.org (Postfix) with ESMTP id 652D85AF024 for ; Thu, 10 Aug 2006 23:31:03 +0000 (GMT) Received: from [192.168.1.10] ([84.19.128.181]) by alimail.net (alimail.net [10.1.8.71]) (MDaemon.PRO.v8.0.4.R) with ESMTP id md50000723230.msg for ; Fri, 11 Aug 2006 01:30:51 +0200 In-Reply-To: <746457F7E51F3B4BB53A8447D7204B78E44F@MVGMAIL.mvg.local> References: <746457F7E51F3B4BB53A8447D7204B78E44F@MVGMAIL.mvg.local> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <7D3E0D83-0581-43CF-A767-91F184203064@tele2.se> Cc: Content-Transfer-Encoding: 7bit From: Niklas Johansson Subject: Re: Date: Fri, 11 Aug 2006 01:30:45 +0200 To: Jonathan Sinclair X-Mailer: Apple Mail (2.752.2) X-Spam-Processed: alimail.net, Fri, 11 Aug 2006 01:30:51 +0200 (not processed: message from trusted or authenticated source) X-MDRemoteIP: 84.19.128.181 X-Return-Path: spot@tele2.se X-MDaemon-Deliver-To: pgsql-sql@postgresql.org Reply-To: spot@tele2.se X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.2 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE X-Spam-Level: X-Archive-Number: 200608/78 X-Sequence-Number: 26036 On 4 aug 2006, at 08.55, Jonathan Sinclair wrote: > SELECT field1, SUM(field2) as Field2, SUM(field3) > FROM table1 tb1, table2 tb2 > WHERE tb1.field5 BETWEEN '03/07/2006' AND '03/08/2006' > AND tb1.field6 = tb2.field7 > AND tb1.field8 = tb2.field8 > AND tb2.field9 BETWEEN 50.00 AND 150.00 > GROUP BY field1 > HAVING SUM(field2) BETWEEN 95.00 AND 100.00 > ORDER BY 2 DESC, field1; > > The results I get from Informix and mySql return identical results, > however postgres includes a great deal more i.e. 11 rows from Informix > and mySQL, 203 from postgres. > > Does anyone have any idea why this disparity may exist? An obvious source of ambiguity is the date comparison: tb1.field5 BETWEEN '03/07/2006' AND '03/08/2006' Is that interval a day or a month (mm/dd/yyyy or dd/mm/yyyy)? Check your datestyle setting and make sure all systems interpret the date correctly (or at least the same). Sincerely, Niklas Johansson