Re: question about a select

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Cindy <ctmoore(at)uci(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: question about a select
Date: 2003-10-09 21:29:18
Message-ID: 20031009142549.K73599@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 9 Oct 2003, Cindy wrote:

> Text=# select distinct on (y_level) y_level, byteloc from
> citations_by_level where aid=543 and wid=1 order by byteloc;
> ERROR: SELECT DISTINCT ON expressions must match initial ORDER BY
> expressions

Maybe something like:

select y_level from (select distinct on (y_level) y_level,
byteloc from citations_by_level where aid=543 and wid=1) tab order by
byteloc;

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Karsten Hilbert 2003-10-09 21:33:08 Re: SQL query problem
Previous Message Cindy 2003-10-09 21:15:45 question about a select