Aliasing on tables ... - Mailing list pgsql-sql

From Hans-Jürgen Schönig
Subject Aliasing on tables ...
Date
Msg-id 3ACDB582.A43B14B7@cybertec.at
Whole thread Raw
List pgsql-sql
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



pgsql-sql by date:

Previous
From: "comp"
Date:
Subject: Sql error
Next
From: Richard
Date:
Subject: pg_dump and oid