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 B943D9DCAE5 for ; Sat, 10 Dec 2005 21:24:37 -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 80686-10 for ; Sat, 10 Dec 2005 21:24:41 -0400 (AST) X-Greylist: delayed 00:15:13.316731 by SQLgrey- Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by postgresql.org (Postfix) with ESMTP id 9D1859DCAB8 for ; Sat, 10 Dec 2005 21:24:35 -0400 (AST) Received: from cfgod (pcp08670491pcs.500ash01.tn.comcast.net[69.137.84.227]) by comcast.net (sccrmhc12) with SMTP id <2005121101243701200loelhe>; Sun, 11 Dec 2005 01:24:38 +0000 From: "Foster, Stephen" To: "'Jaime Casanova'" Cc: =?iso-8859-1?Q?'Havasv=F6lgyi_Ott=F3'?= , Subject: Re: select count of distinct rows Date: Sat, 10 Dec 2005 19:28:03 -0600 Message-ID: <005d01c5fdf2$21d1fcd0$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: Importance: Normal X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.159 required=5 tests=[AWL=-1.159, DNS_FROM_RFC_POST=1.44, DNS_FROM_RFC_WHOIS=0.879] X-Spam-Score: 1.159 X-Spam-Level: * X-Archive-Number: 200512/83 X-Sequence-Number: 23625 Well, I find the problem on my end. I was working with a new database that I forgot to filler yet. Yes, it works. Jaime, I think what he is trying to do is get the record count. I would agree that using that statement is a bit much. But using SELECT COUNT(*) FROM mytable; would give the same thing and should run faster. -----Original Message----- From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Jaime Casanova Sent: Saturday, December 10, 2005 7:13 PM To: Foster, Stephen Cc: Havasv=F6lgyi Ott=F3; pgsql-sql@postgresql.org Subject: Re: [SQL] select count of distinct rows On 12/10/05, Foster, Stephen wrote: > Well this should work but I tried it and it didn't. > > SELECT DISTINCT COUNT(*) FROM mytable; > No, it shouldn't work... actually is a non-sense, count will return just one value so there is nothing to be distinct with... -- regards, Jaime Casanova (DBA: DataBase Aniquilator ;) ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings --=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