syntax for access an alias in the where clause ? - Mailing list pgsql-sql

From Michael Agbaglo
Subject syntax for access an alias in the where clause ?
Date
Msg-id 3D10C770.7040100@shifted-bytes.de
Whole thread Raw
Responses Re: syntax for access an alias in the where clause ?  (Wei Weng <wweng@kencast.com>)
Re: syntax for access an alias in the where clause ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: syntax for access an alias in the where clause ?  (Jeff Eckermann <jeff_eckermann@yahoo.com>)
Re: syntax for access an alias in the where clause ?  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-sql
Hi !

It's long ago since I used SQL :-)

select [expression 1] as [alias 1], [expression 2] as [alias 2]
where [alias 1] < [alias 2]
order by [alias 2] - [alias 1]

---> ERROR:  Attribute '[alias 1]' not found

I found a lot of 'select [expression] as' but I've never seen somebody 
accessing the alias ... Can't this be done ?

M.





pgsql-sql by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: SQL performance issue with PostgreSQL compared to MySQL
Next
From: Wei Weng
Date:
Subject: Which one is faster?