Yes, a big difference. The first returns the distinct COUNT values, but
there is only one, of course. The second returns the number of distinct
values in the column.
---
Wei Weng wrote:
> This is what is on postgresql's ma
On Fri, Nov 01, 2002 at 16:33:32 -0500,
Wei Weng <[EMAIL PROTECTED]> wrote:
> This is what is on postgresql's manual page:
>
> According to this syntax, SELECT DISTINCT COUNT(ID) FROM test
> should be valid while SELECT COUNT(DISTINCT ID) FROM test otherwise.
>
> while in fact, both are valid.
This is what is on postgresql's manual page:
http://www.postgresql.org/idocs/index.php?sql-select.html
SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ]
* | expression [ AS output_name ] [, ...]
[ FROM from_item [, ...] ]
[ WHERE condition ]
[ GROUP BY expression [, ...] ]