Received: from mail3.panix.com (mail3.panix.com [166.84.0.167]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f78DBR636648 for ; Wed, 8 Aug 2001 09:11:27 -0400 (EDT) (envelope-from tomg@admin.nrnet.org) Received: from mailhost.nrnet.org (mailhost.nrnet.org [166.84.192.39]) by mail3.panix.com (Postfix) with ESMTP id 42B75981FA; Wed, 8 Aug 2001 09:11:20 -0400 (EDT) Received: from admin.nrnet.org (uucp@localhost) by mailhost.nrnet.org (8.9.3/8.9.3) with UUCP id JAA13458; Wed, 8 Aug 2001 09:12:08 -0400 Received: from localhost (tomg@localhost) by admin.nrnet.org (8.9.1/8.9.1) with ESMTP id JAA16261; Wed, 8 Aug 2001 09:14:19 -0400 Date: Wed, 8 Aug 2001 09:14:19 -0400 (EDT) From: Thomas Good To: Andreas Joseph Krogh Cc: pgsql-sql@postgresql.org Subject: Re: Referencing named attribute in where clause doesn't work with 7.1.2? In-Reply-To: <3B713729.62D20CCB@officenet.no> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200108/119 X-Sequence-Number: 4340 On Wed, 8 Aug 2001, Andreas Joseph Krogh wrote: > Hi, this is my first post to this list so please... > I have problems getting this query to work, any ideas? > > select article.title_text_key, > (select on_text.text_value from on_text where > on_text.text_key = title_text_key > AND NOT title_text_key is NULL > AND on_text.lang_id = (select code.id from code, code_group where > code.code_group_id = code_group.id > AND code_group.description = 'lang' AND code.code_key = 'lang.NO' > ) > ) > as title_text_value from article where NOT title_text_value is NULL; > > ERROR: Attribute 'title_text_value' not found Hallo Andreas, Relocating your AS clause to the topmost string? BTW, table aliasing would make for less typing. Best of luck! > Issuing the same query without the where-clause does work tho, but > return tupples with null in them which I don't want. > > -- > Andreas Joseph Krogh > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > -------------------------------------------------------------------- SVCMC - Center for Behavioral Health -------------------------------------------------------------------- Thomas Good tomg@ { admin | q8 } .nrnet.org Programmer/Analyst Phone: 718-354-5528 Residential Services Mobile: 917-282-7359 -------------------------------------------------------------------- /* Die Wahrheit Ist Irgendwo Da Draussen... */ --------------------------------------------------------------------