Re: COALESCE in ORDER BY...

From: Andreas Schmitz <andreas(dot)schmitz(at)as-dataservice(dot)de>
To: Terry Yapt <pgsql(at)technovell(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: COALESCE in ORDER BY...
Date: 2003-05-17 17:14:09
Message-ID: 3EC66DE1.1090705@as-dataservice.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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:

SELECT *
FROM (SELECT 10 AS FIRST) AS vtbl
ORDER BY COALESCE(vtbl.first,0) DESC;

(Tested with 7.3.2)

Best regards
--
Andreas Schmitz
AS-DataService <http://www.as-dataservice.de>
Kastanienallee 24
D-54662 Speicher

Tel.: (0 65 62) 93 05 17
Fax: (0 65 62) 93 05 18
Email: andreas(dot)schmitz(at)as-dataservice(dot)de
<mailto:andreas(dot)schmitz(at)as-dataservice(dot)de>

Ust-IdNr.: DE211466407
Handelsregister: HRA 1869 - Amtsgericht Bitburg
<http://www.as-dataservice.de>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2003-05-17 17:41:10 Re: COALESCE in ORDER BY...
Previous Message Terry Yapt 2003-05-17 16:40:01 COALESCE in ORDER BY...