Received: from smtp-relay.noc.dsvr.net (smtp-relay.noc.dsvr.net [212.69.192.4]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBPN5HL79440; Mon, 25 Dec 2000 18:05:17 -0500 (EST) (envelope-from abe@fish.tm) Received: from [212.69.192.199] (helo=fish.serve.co.uk) by smtp-relay.noc.dsvr.net with esmtp (Exim 3.16 #1) id 14AggT-0000VQ-00; Mon, 25 Dec 2000 23:05:37 +0000 Received: from win2k (host213-122-205-40.btinternet.com [213.122.205.40] (may be forged)) by fish.serve.co.uk (8.9.3/8.9.3) with SMTP id XAA01759; Mon, 25 Dec 2000 23:05:30 GMT Message-ID: <001001c06ec8$36bec380$6500a8c0@win2k> From: "Abe" To: "PostgreSQL Hackers List" , Subject: COUNT(Distinct city) HELP!!! Date: Mon, 25 Dec 2000 23:12:50 -0000 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000D_01C06EC8.336A1A40" 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/706 X-Sequence-Number: 1990 This is a multi-part message in MIME format. ------=_NextPart_000_000D_01C06EC8.336A1A40 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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=3D> 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 =3D> select count(distinct city) from ct; ERROR: parser: parse error at or near "distinct" Any guidance would be appreciated... Thanks Abe ------=_NextPart_000_000D_01C06EC8.336A1A40 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hey there,
 
I get this error but I think this is suppo= sed to=20 work:
 
The table has some duplicates such as = ;Munich I=20 want the number of distinct cities:
 
abenew=3D> select * from ct;
name|    age|   =20 city
----       =20 +---      +------
jow  |=20     10|     london
tim |=20      15|     paris
kim |=20     17|     munich
te  =20 |      19|     munich
= (8=20 rows)
 
My query is as follows:
 
tester =3D> select count(distinct city)= from=20 ct;
ERROR:  parser: parse error at or near "distinct"
 
Any guidance would be appreciated...
Thanks
Abe
------=_NextPart_000_000D_01C06EC8.336A1A40--