X-Original-To: pgsql-sql@postgresql.org Received: from localhost (unknown [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id DF006924C56 for ; Sat, 17 May 2003 13:15:16 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 61124-01 for ; Sat, 17 May 2003 13:15:15 -0400 (EDT) Received: from as-dataservice.de (uranus.AS-DataService.de [217.5.243.11]) by developer.postgresql.org (Postfix) with ESMTP id E4915924C51 for ; Sat, 17 May 2003 13:15:13 -0400 (EDT) X-ClamAntivirus: checked Received: from [217.5.243.10] (HELO as-dataservice.de) by as-dataservice.de (CommuniGate Pro SMTP 4.0.6) with ESMTP id 771435; Sat, 17 May 2003 19:20:55 +0200 Message-ID: <3EC66DE1.1090705@as-dataservice.de> Date: Sat, 17 May 2003 19:14:09 +0200 From: Andreas Schmitz User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b) Gecko/20030507 X-Accept-Language: de, en, en-us MIME-Version: 1.0 To: Terry Yapt Cc: pgsql-sql@postgresql.org Subject: Re: COALESCE in ORDER BY... References: <1053189601.81a4c98pgsql@technovell.com> In-Reply-To: <1053189601.81a4c98pgsql@technovell.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/362 X-Sequence-Number: 13527 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 Kastanienallee 24 D-54662 Speicher Tel.: (0 65 62) 93 05 17 Fax: (0 65 62) 93 05 18 Email: andreas.schmitz@as-dataservice.de Ust-IdNr.: DE211466407 Handelsregister: HRA 1869 - Amtsgericht Bitburg