Skip site navigation (1) Skip section navigation (2)

COUNT(Distinct city) HELP!!!

From: "Abe" <abe(at)fish(dot)tm>
To: "PostgreSQL Hackers List" <pgsql-hackers(at)postgresql(dot)org>, <pgsql-general(at)postgresql(dot)org>
Subject: COUNT(Distinct city) HELP!!!
Date: 2000-12-25 23:12:50
Message-ID: 001001c06ec8$36bec380$6500a8c0@win2k (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
Hey there,

I get this error but I think this is supposed to work:

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

Responses

pgsql-hackers by date

Next:From: mlwDate: 2000-12-25 23:23:19
Subject: Re: COUNT(Distinct city) HELP!!!
Previous:From: Oleg BartunovDate: 2000-12-25 04:47:58
Subject: Re: Upper limit on number of buffers?

pgsql-general by date

Next:From: mlwDate: 2000-12-25 23:23:19
Subject: Re: COUNT(Distinct city) HELP!!!
Previous:From: Peter EisentrautDate: 2000-12-25 22:40:18
Subject: Re: initdb error

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group