Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 7F4C19F98BF for ; Tue, 21 Aug 2007 10:23:28 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 46987-06 for ; Tue, 21 Aug 2007 10:23:26 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id BF4E69F9748 for ; Tue, 21 Aug 2007 10:23:25 -0300 (ADT) Received: from server3.office.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id DA0E41444F3; Tue, 21 Aug 2007 14:23:14 +0100 (BST) Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id E303F274054; Tue, 21 Aug 2007 14:23:12 +0100 (BST) Message-ID: <46CAE740.1000304@archonet.com> Date: Tue, 21 Aug 2007 14:23:12 +0100 From: Richard Huxton User-Agent: Thunderbird 2.0.0.0 (X11/20070326) MIME-Version: 1.0 To: "A. R. Van Hook" Cc: postgresql sql list Subject: Re: wrong answer References: <46CAE41E.8020707@lake-lotawana.mo.us> In-Reply-To: <46CAE41E.8020707@lake-lotawana.mo.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/167 X-Sequence-Number: 29105 A. R. Van Hook wrote: > I have a simple (and incorrect queuer) that gives the wrong answer. > Can someone show me the correct syntax? > t > "select sum(s.ref), r.value, s.ref from registry as s ^^^ Simple typo - you've used sum() not count() > qs "select count(*) from registry where ref =3" -- Richard Huxton Archonet Ltd