Bug #42453 | Column name overriding | ||
---|---|---|---|
Submitted: | 29 Jan 2009 14:03 | Modified: | 29 Jan 2009 14:35 |
Reporter: | Alex P | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: General | Severity: | S3 (Non-critical) |
Version: | 5.0.51a-community | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | column name, overriding |
[29 Jan 2009 14:03]
Alex P
[29 Jan 2009 14:27]
Valeriy Kravchuk
This is not a bug. Without comma second name is treated as column alias. Please, read http://dev.mysql.com/doc/refman/5.0/en/select.html: "However, because the AS is optional, a subtle problem can occur if you forget the comma between two select_expr expressions: MySQL interprets the second as an alias name. For example, in the following statement, columnb is treated as an alias name: SELECT columna columnb FROM mytable; For this reason, it is good practice to be in the habit of using AS explicitly when specifying column aliases."
[29 Jan 2009 14:35]
Alex P
ahr.. yes X) didn't intended to use it as alias so run into that problem. Thank you for explain.