Received: from draco.over-yonder.net (mortis.sighup.org [63.147.13.14] (may be forged)) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBQ281L91819 for ; Mon, 25 Dec 2000 21:08:01 -0500 (EST) (envelope-from gh@over-yonder.net) Received: by draco.over-yonder.net (Postfix, from userid 1012) id 76E3162D07; Mon, 25 Dec 2000 20:08:24 -0600 (CST) Date: Mon, 25 Dec 2000 20:08:24 -0600 From: GH To: Abe Cc: pgsql-general@postgresql.org Subject: Re: COUNT(Distinct city) HELP!!! Message-ID: <20001225200824.A30984@over-yonder.net> References: <001001c06ec8$36bec380$6500a8c0@win2k> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <001001c06ec8$36bec380$6500a8c0@win2k>; from abe@fish.tm on Mon, Dec 25, 2000 at 11:12:50PM -0000 X-OS: FreeBSD X-Archive-Number: 200012/708 X-Sequence-Number: 1992 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