counting distinct rows on more than one column - Mailing list pgsql-sql

From Dirk Lutzebaeck
Subject counting distinct rows on more than one column
Date
Msg-id 15041.65308.150764.131312@ampato.core.aeccom.com
Whole thread Raw
Responses Re: counting distinct rows on more than one column
Re: counting distinct rows on more than one column
List pgsql-sql
Hi,

on 7.0.3 want to COUNT
 SELECT DISTINCT a,b FROM t;

I can't find a solution because any combination with
count with more than one column gives syntax errors.

One solution would be to set a view:

CREATE VIEW v AS SELECT DISTINCT a,b FROM t;

and then

SELECT count(a) FROM v

but views don't support distinct in v7.0.3

Ok I could use a temporary table but my select distinct tends to give
large results.

Any clues?

Dirk




pgsql-sql by date:

Previous
From: "Poul L. Christiansen"
Date:
Subject: Re: Killing Postmaster
Next
From: Michael Ansley
Date:
Subject: RE: counting distinct rows on more than one column