Re: [GENERAL] Any ideas why this doesn't work or how to rewrite it? - Mailing list pgsql-general

From Aaron Holtz
Subject Re: [GENERAL] Any ideas why this doesn't work or how to rewrite it?
Date
Msg-id Pine.LNX.4.10.9904281307570.3898-100000@barbarossa.bright.net
Whole thread Raw
In response to Re: [GENERAL] Any ideas why this doesn't work or how to rewrite it?  (Oleg Broytmann <phd@sun.med.ru>)
List pgsql-general
Yes, that is what I'll have to do.  Just counting the number of tuples
returned from this query would work.  I was just wondering why this wasn't
implemented in postgres or what the valid syntax would be.  Thanks!

--------------------------------------------------------------------------
Aaron Holtz
ComNet Inc.
UNIX Systems Specialist
Email:  aholtz@bright.net
"It's not broken, it just lacks duct tape."
--------------------------------------------------------------------------


On Apr 28, Oleg Broytmann molded the electrons to say....

>On Wed, 28 Apr 1999, Aaron Holtz wrote:
>> 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?  I can always
>> just count the number of tuples returned but this seemed to be a valid
>> query.
>
>   In SQL, it is just pretty valid query. But Postgres does not implement
>SELECT COUNT(DISTINCT).
>
>   Do instead
>SELECT DISTINCT(customer_username) FROM customerdata;
>   and count it in your program.
>
>> --------------------------------------------------------------------------
>> Aaron Holtz
>> ComNet Inc.
>> UNIX Systems Specialist
>> Email:  aholtz@bright.net
>> "It's not broken, it just lacks duct tape."
>> --------------------------------------------------------------------------
>
>Oleg.
>----
>    Oleg Broytmann     http://members.xoom.com/phd2/     phd2@earthling.net
>           Programmers don't die, they just GOSUB without RETURN.
>


pgsql-general by date:

Previous
From: Aaron Holtz
Date:
Subject: Re: [GENERAL] Any ideas why this doesn't work or how to rewrite it?
Next
From: "Gene Selkov, Jr."
Date:
Subject: Re: [GENERAL] Any ideas why this doesn't work or how to rewrite it?