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

From Foster, Stephen
Subject Re: select count of distinct rows
Date
Msg-id 005d01c5fdf2$21d1fcd0$2101a8c0@cfgod
Whole thread Raw
In response to Re: select count of distinct rows  (Jaime Casanova <systemguards@gmail.com>)
List pgsql-sql
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



pgsql-sql by date:

Previous
From: Frank Bax
Date:
Subject: Re: select count of distinct rows
Next
From: Havasvölgyi Ottó
Date:
Subject: Re: select count of distinct rows