Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group