Re: BUG Report - Select distinct on

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dirk Elmendorf <delmendo(at)rackspace(dot)com>
Cc: bugs(at)postgresql(dot)org
Subject: Re: BUG Report - Select distinct on
Date: 2000-06-01 21:51:01
Message-ID: 26453.959896261@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Dirk Elmendorf <delmendo(at)rackspace(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2000-06-01 22:22:10 Re: INET operators and NOT
Previous Message Dirk Elmendorf 2000-06-01 20:41:22 BUG Report - Select distinct on