Re: [GENERAL] Column alias in where clause?

2008-08-13 Thread Tom Lane
Martijn van Oosterhout <[EMAIL PROTECTED]> writes: > You can't. Conceptually, the result of the SELECT is not visible until > *after* the WHERE clause has executed, so having the where clause > depend on the select won't work. It's not only conceptual. Consider SELECT 1/x FROM mytab WHER

Re: [GENERAL] Column alias in where clause?

2008-08-13 Thread Jeff Ross
Martijn van Oosterhout wrote: On Wed, Aug 13, 2008 at 10:47:17AM -0600, Jeff Ross wrote: I'm a little confused about how to use a column alias in the where clause of a query. I'm sure the answer is something simple, but I haven't found anything searching through Google or from reading the docs

Re: [GENERAL] Column alias in where clause?

2008-08-13 Thread Martijn van Oosterhout
On Wed, Aug 13, 2008 at 10:47:17AM -0600, Jeff Ross wrote: > I'm a little confused about how to use a column alias in the where > clause of a query. I'm sure the answer is something simple, but I > haven't found anything searching through Google or from reading the docs. You can't. Conceptually

[GENERAL] Column alias in where clause?

2008-08-13 Thread Jeff Ross
I'm a little confused about how to use a column alias in the where clause of a query. I'm sure the answer is something simple, but I haven't found anything searching through Google or from reading the docs. I inherited a table that used to store the name of a facility director as the actual n