Search Postgresql Archives

Re: GROUP BY column alias?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Scott Bailey wrote:
SQL name resolution rules are that column names have higher precedence than aliases and variables. So it will always bind to the column not the alias.


Eric B. Ridge wrote:
That explains it.  Thanks.  Breaks the rule of least surprise, but it is SQL.

I don't think it does break the rule of least surprise. How would one expect the column or the alias to have precedence without knowledge of the rule from documentation? The only thing I would expect if I were unaware of the rule is that there might be a conflict and that I'd have to look up the precedence.

--
Lew

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux