Re: Aliases for Field Names in SELECT statements

From: merlyn(at)stonehenge(dot)com (Randal L(dot) Schwartz)
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
Cc: pdxpug(at)postgresql(dot)org
Subject: Re: Aliases for Field Names in SELECT statements
Date: 2008-01-04 17:18:50
Message-ID: 86wsqp5x1h.fsf@blue.stonehenge.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pdxpug

>>>>> "Rich" == Rich Shepard <rshepard(at)appl-ecosys(dot)com> writes:

Rich> A thread on the postgres users mail list asks how to write a SELECT
Rich> statement using a column alias (e.g., SELECT emp_id AS e FROM employee),
Rich> and Bruce Momjian responded that it's not possible and on the To-Do list
Rich> to not be done.

Are you sure he wasn't talking about the fact that in the standard, aliases
apply *after* the WHERE, but *before* the HAVING, and therefore you can't ever
use aliases in the WHERE clause since they simply don't exist yet?

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn(at)stonehenge(dot)com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

In response to

Responses

Browse pdxpug by date

  From Date Subject
Next Message Randal L. Schwartz 2008-01-04 17:24:30 Re: Aliases for Field Names in SELECT statements
Previous Message Selena Deckelmann 2008-01-04 16:55:50 your Survey