X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2BC5E3A4090 for ; Tue, 16 Nov 2004 22:34:41 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 22472-07 for ; Tue, 16 Nov 2004 22:34:33 +0000 (GMT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id 54F6D3A4061 for ; Tue, 16 Nov 2004 22:34:32 +0000 (GMT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id E30E1356D4; Tue, 16 Nov 2004 14:34:31 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id E08EF351F6; Tue, 16 Nov 2004 14:34:31 -0800 (PST) Date: Tue, 16 Nov 2004 14:34:31 -0800 (PST) From: Stephan Szabo To: "Thomas F.O'Connell" Cc: PgSQL - SQL Subject: Re: Counting Distinct Records In-Reply-To: <6E79C2FE-380B-11D9-95C2-000D93AE0944@sitening.com> Message-ID: <20041116141911.K84773@megazone.bigpanda.com> References: <1B2F7B00-3808-11D9-95C2-000D93AE0944@sitening.com> <20041116115807.E79990@megazone.bigpanda.com> <6E79C2FE-380B-11D9-95C2-000D93AE0944@sitening.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/161 X-Sequence-Number: 19480 On Tue, 16 Nov 2004, Thomas F.O'Connell wrote: > Is there another way to accomplish what the former is doing, then? The only thing I can think of is a subselect in from that uses distinct. select count(*) from (select distinct ...) foo That also theoretically allows you to use select distinct * inside the subselect.