From: | "Eric Jain" <jain(at)gmx(dot)net> |
---|---|
To: | "Andrew McMillan" <Andrew(at)catalyst(dot)net(dot)nz> |
Cc: | "PostgreSQL General" <pgsql-general(at)postgresql(dot)org> |
Subject: | RE: COUNT DISTINCT |
Date: | 2000-07-15 10:45:18 |
Message-ID: | NCBBJFHBEGOIAHBCBNCLAEEMCJAA.jain@gmx.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
> SELECT count( DISTINCT(url,id) ) FROM log;
>
> Seems to work for me...
Thanks... however:
SELECT count( DISTINCT(url,id) ) FROM log;
ERROR: parser: parse error at or near ")"
SELECT count( DISTINCT url,id ) FROM log;
ERROR: Aggregate functions may only have one parameter
SELECT count( DISTINCT ON (url,id) ) FROM log;
ERROR: parser: parse error at or near "on"
...
> Well, actually:
> advert=# select count( distinct ( redirect_from ) ) from redirect;
> count
> -------
> 1980
> (1 row)
>
> rather than:
>
> advert=# select count( redirect_from ) from redirect;
> count
> -------
> 4211
> (1 row)
SELECT count(DISTINCT url) FROM log; does work. The problem is to
extend the DISTINCT over several fields...
--
Eric Jain
From | Date | Subject | |
---|---|---|---|
Next Message | Andrew McMillan | 2000-07-15 10:57:17 | Re: COUNT DISTINCT |
Previous Message | Andrew McMillan | 2000-07-15 09:51:14 | Re: COUNT DISTINCT |