Re: Counting Distinct Records - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: Counting Distinct Records
Date
Msg-id 20041116115807.E79990@megazone.bigpanda.com
Whole thread Raw
In response to Counting Distinct Records  (Thomas F.O'Connell <tfo@sitening.com>)
Responses Re: Counting Distinct Records
List pgsql-sql
On Tue, 16 Nov 2004, Thomas F.O'Connell wrote:

> I am wondering whether the following two forms of SELECT statements are
> logically equivalent:
>
> SELECT COUNT( DISTINCT table.column ) ...
>
> and
>
> SELECT DISTINCT COUNT( * ) ...

Not in general.

The former counts how many distinct table.column values there are.  The
distinct in the latter would be basically meaningless unless there's a
group by involved.



pgsql-sql by date:

Previous
From: Thomas F.O'Connell
Date:
Subject: Counting Distinct Records
Next
From: Thomas F.O'Connell
Date:
Subject: Re: Counting Distinct Records