Re: get row count from a "cursor resultset"

From: Maik Wiege <mswiege(at)gmx(dot)de>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: get row count from a "cursor resultset"
Date: 2005-07-07 08:27:55
Message-ID: 42CCE78B.8010507@gmx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Maik Wiege 2005-07-07 11:29:06 Re: get row count from a "cursor resultset"
Previous Message Oliver Jowett 2005-07-06 23:35:59 Re: get row count from a "cursor resultset"