Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 214CF64FC9F for ; Sat, 22 Nov 2008 12:23:35 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 38575-05 for ; Sat, 22 Nov 2008 12:23:32 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail27.svc.cra.dublin.eircom.net (mail27.svc.cra.dublin.eircom.net [159.134.118.223]) by mail.postgresql.org (Postfix) with SMTP id EDEC064FC85 for ; Sat, 22 Nov 2008 12:23:31 -0400 (AST) Received: (qmail 8366 messnum 3070030 invoked from network[86.46.36.198/unknown]); 22 Nov 2008 16:23:29 -0000 Received: from unknown (HELO ?127.0.0.1?) (86.46.36.198) by mail27.svc.cra.dublin.eircom.net (qp 8366) with SMTP; 22 Nov 2008 16:23:29 -0000 Message-ID: <49283203.4000704@iol.ie> Date: Sat, 22 Nov 2008 16:23:31 +0000 From: Raymond O'Donnell Reply-To: rod@iol.ie User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: Michael Thorsen , 'PostgreSQL' Subject: Re: SQL query References: <4c8d33a90811212033x5e88177eo7a026b10336c975b@mail.gmail.com> <4928297C.1070805@iol.ie> <4c8d33a90811220807h56da5c24w1f94d731ebebdb19@mail.gmail.com> In-Reply-To: <4c8d33a90811220807h56da5c24w1f94d731ebebdb19@mail.gmail.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 081121-0, 21/11/2008), Outbound message X-Antivirus-Status: Clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200811/1147 X-Sequence-Number: 140865 On 22/11/2008 16:07, Michael Thorsen wrote: > For the most part yes. The price and value were "real" columns, > otherwise the rest of it is the same. On a small data set I seem to get That's almost certainly the problem, so - rounding errors are causing the equality test in the join to fail. You should use NUMERIC for those floating-point values. Have a look at what the docs say on REAL and family: http://www.postgresql.org/docs/8.3/static/datatype-numeric.html#DATATYPE-FLOAT Ray. PS - please don't top-post, as it makes the thread difficult to follow. ------------------------------------------------------------------ Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland rod@iol.ie Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals ------------------------------------------------------------------