| Bug #16098 | Ability to reference 'prior' Column Alias in SELECT cols | ||
|---|---|---|---|
| Submitted: | 30 Dec 2005 14:15 | Modified: | 30 Dec 2005 15:33 |
| Reporter: | Azza Azza69 | Email Updates: | |
| Status: | Won't fix | Impact on me: | |
| Category: | MySQL Server | Severity: | S4 (Feature request) |
| Version: | OS: | ||
| Assigned to: | CPU Architecture: | Any | |
[30 Dec 2005 14:15]
Azza Azza69
[30 Dec 2005 15:33]
Valeriy Kravchuk
Thank you for a feature request. Can you, please, name at least one populat RDBMS that supports such a feature?
According to SQL 2003 Standard:
<query specification> ::=
SELECT [ <set quantifier> ] <select list> <table expression>
...
<select sublist> ::=
<derived column>
| <qualified asterisk>
<qualified asterisk> ::=
<asterisked identifier chain> <period> <asterisk>
| <all fields reference>
<asterisked identifier chain> ::=
<asterisked identifier> [ { <period> <asterisked identifier> }... ]
<asterisked identifier> ::= <identifier>
<derived column> ::= <value expression> [ <as clause> ]
...
<numeric value expression> ::=
<term>
| <numeric value expression> <plus sign> <term>
| <numeric value expression> <minus sign> <term>
<term> ::=
<factor>
| <term> <asterisk> <factor>
| <term> <solidus> <factor>
<factor> ::= [ <sign> ] <numeric primary>
<numeric primary> ::=
<value expression primary>
| <numeric value function>
...
<nonparenthesized value expression primary> ::=
<unsigned value specification>
| <column reference>
| <set function specification>
| <window function>
| <scalar subquery>
| <case expression>
| <cast specification>
| <field reference>
| <subtype treatment>
| <method invocation>
| <static method invocation>
| <new specification>
| <attribute or method reference>
| <reference resolution>
| <collection value constructor>
| <array element reference>
| <multiset element reference>
| <routine invocation>
| <next value expression>
you can not use column alias as element of expression. So, I do not think that this feature will be ever implemented.
