pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Havasvölgyi Ottó <h.otto@freemail.hu>
To: pgsql-sql@postgresql.org
To: Frank Bax <fbax@sympatico.ca>
Subject: Re: select count of distinct rows
Date: Sun, 11 Dec 2005 02:29:26 +0100
Message-ID: <008601c5fdf2$5332d380$0200a8c0@OTTO> (raw)
References: <20051209053849.498E8F0BEC@svr2.postgresql.org>
	<5.2.1.1.0.20051210202158.0344ac80@pop6.sympatico.ca>

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






view thread (11+ messages)

Message-ID: <008601c5fdf2$5332d380$0200a8c0@OTTO>
Permalink:  ../008601c5fdf2$5332d380$0200a8c0@OTTO/
Also on:    postgresql.org/message-id/008601c5fdf2$5332d380$0200a8c0@OTTO

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: h.otto@freemail.hu, fbax@sympatico.ca
  Subject: Re: select count of distinct rows
  In-Reply-To: <008601c5fdf2$5332d380$0200a8c0@OTTO>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox