From: Abe <abe@fish.tm>
To: PostgreSQL Hackers List <pgsql-hackers@postgresql.org>
To: pgsql-general@postgresql.org
Subject: COUNT(Distinct city) HELP!!!
Date: Mon, 25 Dec 2000 23:12:50 -0000
Message-ID: <001001c06ec8$36bec380$6500a8c0@win2k> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: abe@fish.tm, pgsql-general@postgresql.org
Subject: Re: COUNT(Distinct city) HELP!!!
In-Reply-To: <001001c06ec8$36bec380$6500a8c0@win2k>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox