Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.3/8.11.1) with ESMTP id f2SGB5U21339 for ; Wed, 28 Mar 2001 11:11:06 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f2SGAqw18318; Wed, 28 Mar 2001 11:11:00 -0500 (EST) To: Dirk Lutzebaeck cc: pgsql-sql@postgresql.org Subject: Re: counting distinct rows on more than one column In-reply-to: <15041.65308.150764.131312@ampato.core.aeccom.com> References: <15041.65308.150764.131312@ampato.core.aeccom.com> Comments: In-reply-to Dirk Lutzebaeck message dated "Wed, 28 Mar 2001 17:11:24 +0200" Date: Wed, 28 Mar 2001 11:10:51 -0500 Message-ID: <18315.985795851@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200103/582 X-Sequence-Number: 2252 Dirk Lutzebaeck writes: > on 7.0.3 want to COUNT > SELECT DISTINCT a,b FROM t; In 7.1 you could do select count(*) from (select distinct a,b from t) as t1; In 7.0 and before I think you have no choice but to use a temp table. regards, tom lane