Re: [GENERAL] Any ideas why this doesn't work or how to rewrite it?

From: "Gene Selkov, Jr(dot)" <selkovjr(at)mcs(dot)anl(dot)gov>
To: Aaron Holtz <aholtz(at)bright(dot)net>, pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Any ideas why this doesn't work or how to rewrite it?
Date: 1999-04-28 17:16:51
Message-ID: 199904281816.NAA03257@antares.mcs.anl.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> This seems like a simple SQL command, but I'm getting errors.
> Running 6.5.0 under RedHat 5.2:
>
> db=> select count(distinct customer_username) from customerdata;
> ERROR: parser: parse error at or near "distinct"
>
> How do you get a count of distinct data output via postgres?

SELECT customer_username, COUNT(customer_username) FROM customerdata GROUP BY customer_username;

Responses

Browse pgsql-general by date

  From Date Subject
Next Message bachir ramdani 1999-04-28 17:50:10
Previous Message Aaron Holtz 1999-04-28 17:08:41 Re: [GENERAL] Any ideas why this doesn't work or how to rewrite it?