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

Re: column alias and group by/having/order

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tomasz Myrta <jasiek(at)klaster(dot)net>
Cc: Lista dyskusyjna pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: column alias and group by/having/order
Date: 2004-02-13 15:15:31
Message-ID: 2373.1076685331@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-sql
Tomasz Myrta <jasiek(at)klaster(dot)net> writes:
> I found some strange column alias behaviour:

That's how it is.  The fact that you can reference output-column aliases
at all in GROUP BY or ORDER BY is a wart, because it conflicts with the
logical model of query evaluation --- the output list should be computed
last.  We have extended the SQL92 requirement (unadorned aliases in
ORDER BY) to allow the same in GROUP BY, but we don't take it to the
level of allowing them inside arbitrary expressions.

			regards, tom lane

In response to

pgsql-sql by date

Next:From: Jatinder SanghaDate: 2004-02-13 15:24:48
Subject: Passing composite values to functions
Previous:From: Stephan SzaboDate: 2004-02-13 15:02:51
Subject: Re: 7.4 - FK constraint performance

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