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 E5F3A9DCAE5 for ; Sat, 10 Dec 2005 21:29:26 -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 85954-02 for ; Sat, 10 Dec 2005 21:29:30 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from viefep18-int.chello.at (viefep18-int.chello.at [213.46.255.21]) by postgresql.org (Postfix) with ESMTP id 2C4709DCAB8 for ; Sat, 10 Dec 2005 21:29:23 -0400 (AST) Received: from OTTO ([213.222.166.137]) by viefep18-int.chello.at (InterMail vM.6.01.04.04 201-2131-118-104-20050224) with SMTP id <20051211012926.NLJX25506.viefep18-int.chello.at@OTTO>; Sun, 11 Dec 2005 02:29:26 +0100 Message-ID: <008601c5fdf2$5332d380$0200a8c0@OTTO> From: =?iso-8859-1?Q?Havasv=F6lgyi_Ott=F3?= To: , "Frank Bax" References: <20051209053849.498E8F0BEC@svr2.postgresql.org> <5.2.1.1.0.20051210202158.0344ac80@pop6.sympatico.ca> Subject: Re: select count of distinct rows Date: Sun, 11 Dec 2005 02:29:26 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[AWL=0.000] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/85 X-Sequence-Number: 23627 Oh, that's it. Thank you all very much. Otto ----- Original Message ----- From: "Frank Bax" To: Sent: Sunday, December 11, 2005 2:23 AM Subject: Re: [SQL] select count of distinct rows At 07:53 PM 12/10/05, Havasvölgyi Ottó 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; ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org