SELECT DISTINCT question - Mailing list pgsql-sql

From Oleg Bartunov
Subject SELECT DISTINCT question
Date
Msg-id Pine.GSO.3.96.SK.990711000908.2043R-100000@ra
Whole thread Raw
Responses Re: [HACKERS] SELECT DISTINCT question
List pgsql-sql
I got a problem with query:

select distinct (date), bytes  from access_log;

which works but not as I expect. I thought this query will select
all rows with distinct values of 'date' column, but it get
distinct pairs 'date, bytes' . From documnetation I see

"DISTINCT will eliminate all duplicate rows from the selection. 
DISTINCT ON column will eliminate all duplicates in the specified column; 
this is equivalent to using GROUP BY column. 
ALL will return all candidate rows, including duplicates."      
discovery=> select distinct on date,bytes  from access_log;
ERROR:  parser: parse error at or near ","
Regards,
    Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83




pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: [SQL] Oddities with NULL and GROUP BY
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] SELECT DISTINCT question