X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 50E0552A09 for ; Thu, 7 Jul 2005 09:26:32 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 87291-10 for ; Thu, 7 Jul 2005 12:26:29 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 75C6D529C2 for ; Thu, 7 Jul 2005 09:26:27 -0300 (ADT) Received: (qmail 21956 invoked from network); 7 Jul 2005 12:24:28 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (64.7.143.116) by net2.micro-automation.com with SMTP; 7 Jul 2005 12:24:28 -0000 In-Reply-To: <42CD1202.8030705@gmx.de> References: <42CC2EB6.8020505@gmx.de> <42CC5ACE.5070200@opencloud.com> <42CC5C41.90306@opencloud.com> <42CC604A.9050604@opencloud.com> <42CC6A5A.2000605@gmx.de> <42CC6ADF.5040504@opencloud.com> <42CCE78B.8010507@gmx.de> <42CCEFD7.2000203@opencloud.com> <42CD1202.8030705@gmx.de> Mime-Version: 1.0 (Apple Message framework v730) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <54B9D950-10C5-4495-9531-3F7A4406CE55@fastcrypt.com> Cc: Oliver Jowett , pgsql-jdbc@postgresql.org Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: get row count from a "cursor resultset" Date: Thu, 7 Jul 2005 08:26:29 -0400 To: Maik Wiege X-Mailer: Apple Mail (2.730) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.017 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/40 X-Sequence-Number: 13188 Maik, Your only choice may be to do two separate queries. This isn't quite as bad as you think, as the count will load the buffers with your query If you need exactly the right amount, make sure you do this in a transaction. Dave On 7-Jul-05, at 7:29 AM, Maik Wiege wrote: > Oliver Jowett schrieb: > >> Try COUNT(distinct REGISTER.pd.pdkz) perhaps >> > Hi! > SELECT COUNT(DISTINCT REGISTER.pd.pdkz) > FROM REGISTER.pd JOIN > REGISTER.vornamen ON REGISTER.vornamen.pdkz = REGISTER.pd.pdkz > > works, but with that of cource I don't get the data, just the > amount of rows, so I would have to call it another time without > COUNT to get the data. > > A query like that > SELECT COUNT(DISTINCT REGISTER.pd.pdkz), DISTINCT REGISTER.pd.pdkz > FROM REGISTER.pd JOIN > REGISTER.vornamen ON REGISTER.vornamen.pdkz = REGISTER.pd.pdkz > gives the same mentioned error: column "pd.pdkz" must appear in the > GROUP BY clause or be used in an aggregate function > > Any ideas anyone? > > ---------------------------(end of > broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org > >