Re: COALESCE in ORDER BY...

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Andreas Schmitz <andreas(dot)schmitz(at)as-dataservice(dot)de>
Cc: Terry Yapt <pgsql(at)technovell(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: COALESCE in ORDER BY...
Date: 2003-05-17 17:41:10
Message-ID: 20030517103937.K99993-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Sat, 17 May 2003, Andreas Schmitz wrote:

> Terry Yapt wrote:
>
> >www=> SELECT 10 AS first ORDER BY COALESCE(first,0) DESC;
> >ERROR: Attribute "first" not found
> >
> >Thanks in advance..
> >
> >
> Perhaps, this is a bug, but I have a workarround for you till this is
> clariefied:

Just an unimplemented enhancement I think. At least in SQL92, order
by expressions need to be column references (possibly with collation
conversions), we allow some functional order by expressions, but not one's
referencing select aliases I think.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Terry Yapt 2003-05-18 11:27:41 Re: COALESCE in ORDER BY...
Previous Message David W Noon 2003-05-17 17:14:09 Re: how to use an aggregate function