Re: COUNT(Distinct city) HELP!!!

From: GH <grasshacker(at)over-yonder(dot)net>
To: Abe <abe(at)fish(dot)tm>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: COUNT(Distinct city) HELP!!!
Date: 2000-12-26 02:08:24
Message-ID: 20001225200824.A30984@over-yonder.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Mon, Dec 25, 2000 at 11:12:50PM -0000, some SMTP stream spewed forth:
> Hey there,
>
> I get this error but I think this is supposed to work:

Hrm, it works here on 7.0.2 where each field is "text".

=> select version();
version
-----------------------------------------------------------------
PostgreSQL 7.0.2 on i386-unknown-freebsdelf4.0, compiled by cc
(1 row)

I wish that I could actually *help* you, but I can not. ;-(

G'luck.

gh

>
> The table has some duplicates such as Munich I want the number of distinct cities:
>
> abenew=> select * from ct;
> name| age| city
> ---- +--- +------
> jow | 10| london
> tim | 15| paris
> kim | 17| munich
> te | 19| munich
> (8 rows)
>
> My query is as follows:
>
> tester => select count(distinct city) from ct;
> ERROR: parser: parse error at or near "distinct"
>
> Any guidance would be appreciated...
> Thanks
> Abe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message mlw 2000-12-26 02:39:47 Re: COUNT(Distinct city) HELP!!!
Previous Message Stephan Szabo 2000-12-26 01:27:30 Re: COUNT(Distinct city) HELP!!!

Browse pgsql-hackers by date

  From Date Subject
Next Message mlw 2000-12-26 02:39:47 Re: COUNT(Distinct city) HELP!!!
Previous Message Brent Verner 2000-12-26 02:01:06 Re: 7.1 on DEC/Alpha