Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f0IJDL091302 for ; Thu, 18 Jan 2001 14:13:21 -0500 (EST) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0ICxE047585 for ; Thu, 18 Jan 2001 07:59:14 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f0ICbUq50965 for pgsql-sql@postgresql.org; Thu, 18 Jan 2001 07:37:30 -0500 (EST) (envelope-from news) From: Mikael Hedin X-Newsgroups: comp.databases.postgresql.sql Subject: problem to count (distinct number) Date: 17 Jan 2001 16:51:34 +0100 Lines: 24 Message-ID: <8766jemb21.fsf@zodiac.irf.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@umu.se User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Crater Lake) To: pgsql-sql@postgresql.org X-Archive-Number: 200101/224 X-Sequence-Number: 891 Hi, I have a table with a column (int4), and I want to know how many different numbers there are. In an example book I saw the query SELECT COUNT (DISTINCT data ) FROM media; by then I get ERROR: parser: parse error at or near "distinct" Is the query in error or does PostgreSQL not support this? How do I then get the number of distinct data from my table? TIA, Micce -- Mikael Hedin, MSc +46 (0)980 79176 Swedish Institute of Space Physics +46 (0)8 344979 (home) S-Box 812, 981 28 KIRUNA, Sweden +46 (0)70 5891533 (mobile)