Re: get row count from a "cursor resultset" - Mailing list pgsql-jdbc

From Maik Wiege
Subject Re: get row count from a "cursor resultset"
Date
Msg-id 42CCE78B.8010507@gmx.de
Whole thread Raw
In response to Re: get row count from a "cursor resultset"  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
Oliver Jowett schrieb:
> Maik Wiege wrote:
>
>
>>But what can I do about my problem? Isn't this a very
>>common problem? Can't imagine any user querying a database and does not
>>want to be informed how many results he got...
>
>
> Well, as I suggested before, use DECLARE CURSOR / MOVE / FETCH, or
> include a COUNT(*) column in your original query.
>
Hi! Could you give me an example how to do it? I can't fugure it out. If
I put the COUNT(*) in my query:
SELECT DISTINCT REGISTER.pd.pdkz, COUNT(*) FROM REGISTER.pd JOIN
REGISTER.vornamen ON REGISTER.vornamen.pdkz = REGISTER.pd.pdkz
the sql error comes up:
ERROR:  column "pd.pdkz" must appear in the GROUP BY clause or be used
in an aggregate function

Thanks for any help
   Maik

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: get row count from a "cursor resultset"
Next
From: Maik Wiege
Date:
Subject: Re: get row count from a "cursor resultset"