Re: select count of distinct rows

From: "Foster, Stephen" <stephenlfoster(at)comcast(dot)net>
To: "'Jaime Casanova'" <systemguards(at)gmail(dot)com>
Cc: 'Havasvölgyi Ottó' <h(dot)otto(at)freemail(dot)hu>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: select count of distinct rows
Date: 2005-12-11 01:28:03
Message-ID: 005d01c5fdf2$21d1fcd0$2101a8c0@cfgod
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org
[mailto:pgsql-sql-owner(at)postgresql(dot)org] On Behalf Of Jaime Casanova
Sent: Saturday, December 10, 2005 7:13 PM
To: Foster, Stephen
Cc: Havasvölgyi Ottó; pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] select count of distinct rows

On 12/10/05, Foster, Stephen <stephenlfoster(at)comcast(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Havasvölgyi Ottó 2005-12-11 01:29:26 Re: select count of distinct rows
Previous Message Havasvölgyi Ottó 2005-12-11 01:25:20 Re: select count of distinct rows