Skip site navigation (1) Skip section navigation (2)

Aliases for Field Names in SELECT statements

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pdxpug(at)postgresql(dot)org
Subject: Aliases for Field Names in SELECT statements
Date: 2008-01-04 14:51:23
Message-ID: Pine.LNX.4.64.0801040646500.5706@salmo.appl-ecosys.com (view raw or flat)
Thread:
Lists: pdxpug
   A thread on the postgres users mail list asks how to write a SELECT
statement using a column alias (e.g., SELECT emp_id AS e FROM employee), and
Bruce Momjian responded that it's not possible and on the To-Do list to not
be done.

   I ask if this is correct or if Bruce mis-understood the original statement
that the SQL standard makes aliases optional in implementation.

   All the SQL books I've read heavily use aliases in complex, multi-level
SELECT statements so I just assumed that postgres allowed their use.

Rich

-- 
Richard B. Shepard, Ph.D.               |  Integrity            Credibility
Applied Ecosystem Services, Inc.        |            Innovation
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863

Responses

pdxpug by date

Next:From: Roth, GabrielleDate: 2008-01-04 15:16:48
Subject: Re: Call for meeting topics! Next meeting: January 17
Previous:From: Hu, WilliamDate: 2008-01-04 01:58:50
Subject: Re: Call for meeting topics! Next meeting: January 17

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group