Re: COUNT on a DISTINCT query

From: Suller András <suan2(at)freemail(dot)hu>
To: Freddy Villalba Arias <fvillalba(at)madrid(dot)bilbomatica(dot)es>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: COUNT on a DISTINCT query
Date: 2004-05-07 14:19:24
Message-ID: 409B9AEC.1080302@freemail.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> SELECT COUNT(xxx.*) FROM (<the query above>) xxx

This cause an error for me:
ERROR: cannot pass result of subquery or join "xxx" to a function

Try this instead:
SELECT COUNT(*) FROM (<the query above>) xxx
It worked for me.
Regards,
Suller Andras

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jean-Luc Lachance 2004-05-07 17:31:36 Re: SUM() & GROUP BY
Previous Message Richard Huxton 2004-05-07 13:25:51 Re: SUM() & GROUP BY