Re: select count of distinct rows

From: Havasvölgyi Ottó <h(dot)otto(at)freemail(dot)hu>
To: "Jaime Casanova" <systemguards(at)gmail(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: select count of distinct rows
Date: 2005-12-11 01:07:00
Message-ID: 005501c5fdef$30be34f0$0200a8c0@OTTO
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

Yes, I need to compare all fields. Well, in this case it does not. Is this
impossible?

Thanks,
Otto

----- Original Message -----
From: "Jaime Casanova" <systemguards(at)gmail(dot)com>
To: "Havasvölgyi Ottó" <h(dot)otto(at)freemail(dot)hu>
Cc: <pgsql-sql(at)postgresql(dot)org>
Sent: Sunday, December 11, 2005 1:57 AM
Subject: Re: [SQL] select count of distinct rows

On 12/10/05, Havasvölgyi Ottó <h(dot)otto(at)freemail(dot)hu> wrote:
> Hi,
>
> I would like to select the count of distinct rows in a table.
>
> SELECT COUNT(DISTINCT *) FROM mytable;
>

are really all the fields distincts? the table doesn't have a pk?

> This does not work. How can I do it with Postgres?
>
> Thanks,
> Otto
>

--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jaime Casanova 2005-12-11 01:12:41 Re: select count of distinct rows
Previous Message Jaime Casanova 2005-12-11 00:57:10 Re: select count of distinct rows