Re: get row count from a "cursor resultset"

Поиск
Список
Период
Сортировка
От Maik Wiege
Тема Re: get row count from a "cursor resultset"
Дата
Msg-id 42CCE78B.8010507@gmx.de
обсуждение исходный текст
Ответ на Re: get row count from a "cursor resultset"  (Oliver Jowett <oliver@opencloud.com>)
Список 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 по дате отправления:

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: get row count from a "cursor resultset"
Следующее
От: Maik Wiege
Дата:
Сообщение: Re: get row count from a "cursor resultset"