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

From Havasvölgyi Ottó
Subject Re: select count of distinct rows
Date
Msg-id 008601c5fdf2$5332d380$0200a8c0@OTTO
Whole thread Raw
In response to unsubscribe  ("Dinesh Pandey" <dpandey@secf.com>)
List pgsql-sql
Oh, that's it.
Thank you all very much.

Otto



----- Original Message ----- 
From: "Frank Bax" <fbax@sympatico.ca>
To: <pgsql-sql@postgresql.org>
Sent: Sunday, December 11, 2005 2:23 AM
Subject: Re: [SQL] select count of distinct rows


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;


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
              http://archives.postgresql.org





pgsql-sql by date:

Previous
From: Havasvölgyi Ottó
Date:
Subject: Re: select count of distinct rows
Next
From: "Foster, Stephen"
Date:
Subject: Looking for information on PostgreSQL Stored Procedures