From: Foster, Stephen <stephenlfoster@comcast.net>
To: 'Jaime Casanova' <systemguards@gmail.com>
Cc: 'Havasvölgyi Ottó' <h.otto@freemail.hu>
Cc: pgsql-sql@postgresql.org
Subject: Re: select count of distinct rows
Date: Sat, 10 Dec 2005 19:28:03 -0600
Message-ID: <005d01c5fdf2$21d1fcd0$2101a8c0@cfgod> (raw)
In-Reply-To: <c2d9e70e0512101712u760f3eb4x3f5b0820233d0530@mail.gmail.com>
Well, I find the problem on my end. I was working with a new database
that I forgot to filler yet. Yes, it works. Jaime, I think what he is
trying to do is get the record count. I would agree that using that
statement is a bit much. But using SELECT COUNT(*) FROM mytable; would
give the same thing and should run faster.
-----Original Message-----
From: pgsql-sql-owner@postgresql.org
[mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Jaime Casanova
Sent: Saturday, December 10, 2005 7:13 PM
To: Foster, Stephen
Cc: Havasvölgyi Ottó; pgsql-sql@postgresql.org
Subject: Re: [SQL] select count of distinct rows
On 12/10/05, Foster, Stephen <stephenlfoster@comcast.net> wrote:
> Well this should work but I tried it and it didn't.
>
> SELECT DISTINCT COUNT(*) FROM mytable;
>
No, it shouldn't work... actually is a non-sense, count will return
just one value so there is nothing to be distinct with...
--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
--
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, systemguards@gmail.com, h.otto@freemail.hu
Subject: Re: select count of distinct rows
In-Reply-To: <005d01c5fdf2$21d1fcd0$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