From: Foster, Stephen <stephenlfoster@comcast.net>
To: 'Havasvölgyi Ottó' <h.otto@freemail.hu>
To: 'Jaime Casanova' <systemguards@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: select count of distinct rows
Date: Sat, 10 Dec 2005 19:12:49 -0600
Message-ID: <005c01c5fdf0$01b90c10$2101a8c0@cfgod> (raw)
In-Reply-To: <005501c5fdef$30be34f0$0200a8c0@OTTO>
Well this should work but I tried it and it didn't.
SELECT DISTINCT COUNT(*) FROM mytable;
-----Original Message-----
From: pgsql-sql-owner@postgresql.org
[mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Havasvölgyi Ottó
Sent: Saturday, December 10, 2005 7:07 PM
To: Jaime Casanova
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] select count of distinct rows
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@gmail.com>
To: "Havasvölgyi Ottó" <h.otto@freemail.hu>
Cc: <pgsql-sql@postgresql.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.otto@freemail.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
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/197 - Release Date:
12/9/2005
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/197 - Release Date:
12/9/2005
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: stephenlfoster@comcast.net, h.otto@freemail.hu, systemguards@gmail.com
Subject: Re: select count of distinct rows
In-Reply-To: <005c01c5fdf0$01b90c10$2101a8c0@cfgod>
* 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