Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f382hW854881 for ; Sat, 7 Apr 2001 22:43:32 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f36CP1813902 for ; Fri, 6 Apr 2001 08:25:09 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f36CKrU61300 for pgsql-sql@postgresql.org; Fri, 6 Apr 2001 08:20:53 -0400 (EDT) (envelope-from news) From: =?iso-8859-1?Q?Hans=2DJ=FCrgen=20Sch=F6nig?= X-Newsgroups: comp.databases.postgresql.sql Subject: Aliasing on tables ... Date: Fri, 06 Apr 2001 14:24:34 +0200 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 24 Message-ID: <3ACDB582.A43B14B7@cybertec.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.76 [de] (X11; U; Linux 2.2.16-22 i686) X-Accept-Language: en To: pgsql-sql@postgresql.org X-Archive-Number: 200104/107 X-Sequence-Number: 2447 Is there any possibility to access a column using the alias for the column in the where clause? Queries like that don't seem to work: SELECT name || ' bought ' || amount || ' units' AS result FROM sales where result='abc'; ERROR: Attribute 'result' not found That works perfectly well: SELECT name || ' bought ' || amount || ' units' AS result FROM sales where name || ' bought ' || amount || ' units'='abc'; result -------- (0 rows) Is there any possibility to do this with PostgreSQL 7.0.3? Hans