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 30FED9DCAE5 for ; Sat, 10 Dec 2005 21:07:03 -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 78003-08 for ; Sat, 10 Dec 2005 21:07:06 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from viefep16-int.chello.at (viefep16-int.chello.at [213.46.255.17]) by postgresql.org (Postfix) with ESMTP id 2634C9DCAB8 for ; Sat, 10 Dec 2005 21:06:59 -0400 (AST) Received: from OTTO ([213.222.166.137]) by viefep16-int.chello.at (InterMail vM.6.01.04.04 201-2131-118-104-20050224) with SMTP id <20051211010700.MLVS21578.viefep16-int.chello.at@OTTO>; Sun, 11 Dec 2005 02:07:00 +0100 Message-ID: <005501c5fdef$30be34f0$0200a8c0@OTTO> From: =?iso-8859-1?Q?Havasv=F6lgyi_Ott=F3?= To: "Jaime Casanova" Cc: References: <20051209053849.498E8F0BEC@svr2.postgresql.org> <003001c5fded$53a2c5a0$0200a8c0@OTTO> Subject: Re: select count of distinct rows Date: Sun, 11 Dec 2005 02:07:00 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original 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.001 required=5 tests=[AWL=0.001] X-Spam-Score: 0.001 X-Spam-Level: X-Archive-Number: 200512/77 X-Sequence-Number: 23619 Hi, Yes, I need to compare all fields. Well, in this case it does not. Is this impossible? Thanks, Otto ----- Original Message ----- From: "Jaime Casanova" To: "Havasvölgyi Ottó" Cc: Sent: Sunday, December 11, 2005 1:57 AM Subject: Re: [SQL] select count of distinct rows On 12/10/05, Havasvölgyi Ottó wrote: > Hi, > > I would like to select the count of distinct rows in a table. > > SELECT COUNT(DISTINCT *) FROM mytable; > are really all the fields distincts? the table doesn't have a pk? > This does not work. How can I do it with Postgres? > > Thanks, > Otto > -- regards, Jaime Casanova (DBA: DataBase Aniquilator ;) ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org