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 11:29:06
Message-ID: 42CD1202.8030705@gmx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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?

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2005-07-07 12:26:29 Re: get row count from a "cursor resultset"
Previous Message Maik Wiege 2005-07-07 08:27:55 Re: get row count from a "cursor resultset"