Re: BUG Report - Select distinct on - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG Report - Select distinct on
Date
Msg-id 26453.959896261@sss.pgh.pa.us
Whole thread Raw
In response to BUG Report - Select distinct on  (Dirk Elmendorf <delmendo@rackspace.com>)
List pgsql-bugs
Dirk Elmendorf <delmendo@rackspace.com> writes:
> select distinct on label label from test;

> ERROR:parser: parse error at or near "label";

The syntax is different in 7.0.  Try

select distinct on (label) label from test;

Sorry about the loss of backwards compatibility, but this lets you
select distinct on expressions and even multiple expressions, which
wasn't possible with the old column-name-only syntax...

            regards, tom lane

pgsql-bugs by date:

Previous
From: Dirk Elmendorf
Date:
Subject: BUG Report - Select distinct on
Next
From: Bruce Momjian
Date:
Subject: Re: INET operators and NOT