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 5CD8B9DCAE5 for ; Sat, 10 Dec 2005 21:10:54 -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 79545-07 for ; Sat, 10 Dec 2005 21:10:57 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [63.240.77.82]) by postgresql.org (Postfix) with ESMTP id 27DF39DCAB8 for ; Sat, 10 Dec 2005 21:10:51 -0400 (AST) Received: from cfgod (pcp08670491pcs.500ash01.tn.comcast.net[69.137.84.227]) by comcast.net (sccrmhc12) with SMTP id <2005121101092401200lm0v2e>; Sun, 11 Dec 2005 01:09:25 +0000 From: "Foster, Stephen" To: =?iso-8859-1?Q?'Havasv=F6lgyi_Ott=F3'?= , "'Jaime Casanova'" Cc: Subject: Re: select count of distinct rows Date: Sat, 10 Dec 2005 19:12:49 -0600 Message-ID: <005c01c5fdf0$01b90c10$2101a8c0@cfgod> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 In-Reply-To: <005501c5fdef$30be34f0$0200a8c0@OTTO> Importance: Normal 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/78 X-Sequence-Number: 23620 Well this should work but I tried it and it didn't. SELECT DISTINCT COUNT(*) FROM mytable; -----Original Message----- From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Havasv=F6lgyi = Ott=F3 Sent: Saturday, December 10, 2005 7:07 PM To: Jaime Casanova Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] select count of distinct rows Hi, Yes, I need to compare all fields. Well, in this case it does not. Is this=20 impossible? Thanks, Otto ----- Original Message -----=20 From: "Jaime Casanova" To: "Havasv=F6lgyi Ott=F3" Cc: Sent: Sunday, December 11, 2005 1:57 AM Subject: Re: [SQL] select count of distinct rows On 12/10/05, Havasv=F6lgyi Ott=F3 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 ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org --=20 No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.13.13/197 - Release Date: 12/9/2005 =20 --=20 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.13.13/197 - Release Date: 12/9/2005 =20