On Thu, 29 Apr 1999, Herouth Maoz wrote:
> At 18:50 +0300 on 28/04/1999, Aaron Holtz wrote:
>
>
> > 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
Yes, I'm just taking the value ntuples returned after doing:
select distinct customer_username from customerdata group by
customer_username;
I guess my big thing was that I saw a couple of
select count(distinct something) from table;
examples in an SQL book that I have. Was just curious as
Hey there...
> SELECT customer_username, COUNT(customer_username) FROM customerdata GROUP BY
>customer_username;
>
The above query, in effect, does the same thing that:
SELECT DISTINCT(customer_username) from customerdata
does. In order to get the total number of distinct customer_username
> 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 cus
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 Ho