Re: select count of distinct rows - Mailing list pgsql-sql

From Frank Bax
Subject Re: select count of distinct rows
Date
Msg-id 5.2.1.1.0.20051210202158.0344ac80@pop6.sympatico.ca
Whole thread Raw
In response to select count of distinct rows  (Havasvölgyi Ottó <h.otto@freemail.hu>)
List pgsql-sql
At 07:53 PM 12/10/05, Havasvölgyi Ottó wrote:
>I would like to select the count of distinct rows in a table.
>         SELECT COUNT(DISTINCT *) FROM mytable;
>This does not work. How can I do it with Postgres?


select count(*) from (select distinct * from mytable) as x;



pgsql-sql by date:

Previous
From: Havasvölgyi Ottó
Date:
Subject: Re: select count of distinct rows
Next
From: "Foster, Stephen"
Date:
Subject: Re: select count of distinct rows