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 5521B9DCD4F for ; Sat, 10 Dec 2005 20:57:11 -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 78013-05 for ; Sat, 10 Dec 2005 20:57:12 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.196]) by postgresql.org (Postfix) with ESMTP id 349129DCC09 for ; Sat, 10 Dec 2005 20:57:06 -0400 (AST) Received: by wproxy.gmail.com with SMTP id 69so1166296wra for ; Sat, 10 Dec 2005 16:57:10 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=FU5VJZmSIsTzhWqJ+TEFMImnN5CppfXWoLqhJLKHvnFIjEOvGVhdGDT0EGO3IEayQa9KCE+RCoqN0quzcF+T5DQ7jrUEVeb3Ds4lQQHbRSxeoijBl/PxlV27hqQqX/+yg3BfJzhE/LeeZ53kN7vZJyyF18UtCQAg3HMimJcjqWs= Received: by 10.54.117.11 with SMTP id p11mr6566073wrc; Sat, 10 Dec 2005 16:57:10 -0800 (PST) Received: by 10.54.98.6 with HTTP; Sat, 10 Dec 2005 16:57:10 -0800 (PST) Message-ID: Date: Sat, 10 Dec 2005 19:57:10 -0500 From: Jaime Casanova To: =?ISO-8859-1?Q?Havasv=F6lgyi_Ott=F3?= Subject: Re: select count of distinct rows Cc: pgsql-sql@postgresql.org In-Reply-To: <003001c5fded$53a2c5a0$0200a8c0@OTTO> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20051209053849.498E8F0BEC@svr2.postgresql.org> <003001c5fded$53a2c5a0$0200a8c0@OTTO> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.138 required=5 tests=[AWL=0.138] X-Spam-Score: 0.138 X-Spam-Level: X-Archive-Number: 200512/76 X-Sequence-Number: 23618 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 ;)