Received: from cmailg7.svr.pol.co.uk (cmailg7.svr.pol.co.uk [195.92.195.177]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBQC6JL28719 for ; Tue, 26 Dec 2000 07:06:19 -0500 (EST) (envelope-from abe@fish.tm) Received: from [195.92.67.23] (helo=mail18.svr.pol.co.uk) by cmailg7.svr.pol.co.uk with esmtp (Exim 3.13 #0) id 14AssI-0005yY-00; Tue, 26 Dec 2000 12:06:38 +0000 Received: from modem-229.garibaldi.dialup.pol.co.uk ([62.137.16.229] helo=win2k) by mail18.svr.pol.co.uk with smtp (Exim 3.13 #0) id 14AssG-00057X-00; Tue, 26 Dec 2000 12:06:37 +0000 Message-ID: <000e01c06f35$567609a0$6500a8c0@win2k> From: "Abe" To: "Anand Raman" , References: <001001c06ec8$36bec380$6500a8c0@win2k> <20001226121343.A683@india-today.com> Subject: Re: COUNT(Distinct city) HELP!!! Date: Tue, 26 Dec 2000 12:14:02 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-Archive-Number: 200012/710 X-Sequence-Number: 1994 No Joy, unfortunately - It may well be time to upgrade. Thanks, Abe ----- Original Message ----- From: "Anand Raman" To: Sent: Tuesday, December 26, 2000 6:43 AM Subject: Re: [GENERAL] COUNT(Distinct city) HELP!!! > or u can also try > > select count(*) > from > (select distinct city from ct); > > Hope this helps > Anand > > On Mon, Dec 25, 2000 at 05:27:30PM -0800, Stephan Szabo wrote: > > > >I believe that functionality was added in version 7.0, > >are you using an earlier version? > > > >On Mon, 25 Dec 2000, Abe wrote: > > > >> 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 > >> >