X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 1278E9DCC09 for ; Sat, 10 Dec 2005 21:23:56 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 82227-03 for ; Sat, 10 Dec 2005 21:23:59 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from tomts36-srv.bellnexxia.net (tomts36.bellnexxia.net [209.226.175.93]) by postgresql.org (Postfix) with ESMTP id 712519DCC78 for ; Sat, 10 Dec 2005 21:23:53 -0400 (AST) Received: from acer.sympatico.ca ([65.95.186.80]) by tomts36-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20051211012356.GBQF5032.tomts36-srv.bellnexxia.net@acer.sympatico.ca> for ; Sat, 10 Dec 2005 20:23:56 -0500 Message-Id: <5.2.1.1.0.20051210202158.0344ac80@pop6.sympatico.ca> X-Sender: b1wudu74@pop6.sympatico.ca X-Mailer: QUALCOMM Windows Eudora Version 5.2.1 Date: Sat, 10 Dec 2005 20:23:14 -0500 To: From: Frank Bax Subject: Re: select count of distinct rows In-Reply-To: <003001c5fded$53a2c5a0$0200a8c0@OTTO> References: <20051209053849.498E8F0BEC@svr2.postgresql.org> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Transfer-Encoding: quoted-printable X-Originating-IP: [0] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/82 X-Sequence-Number: 23624 At 07:53 PM 12/10/05, Havasv=F6lgyi Ott=F3 wrote: >I would like to select the count of distinct rows in a table. > SELECT COUNT(DISTINCT *) FROM mytable; >This does not work. How can I do it with Postgres? select count(*) from (select distinct * from mytable) as x;