Bug #20743 | Inconsistent behaviour with subqueries, joins, and SELECT * | ||
---|---|---|---|
Submitted: | 28 Jun 2006 3:30 | Modified: | 28 Jun 2006 23:24 |
Reporter: | [ name withheld ] | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.0.22 | OS: | Windows (Windows) |
Assigned to: | CPU Architecture: | Any |
[28 Jun 2006 3:30]
[ name withheld ]
[28 Jun 2006 8:00]
Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php You can also read about current behaviour here: http://bugs.mysql.com/bug.php?id=6709
[28 Jun 2006 23:24]
[ name withheld ]
I can't find it ANYWHERE in the manual as stating that you can't do this; in particular I'd expect it in any of: http://dev.mysql.com/doc/refman/5.0/en/unnamed-views.html http://dev.mysql.com/doc/refman/5.0/en/subqueries.html http://dev.mysql.com/doc/refman/5.0/en/row-subqueries.html There's only a vague comment about UNIONs.
[29 Jun 2006 0:07]
MySQL Verification Team
Thank you for the feedback. Here is the explanation: http://dev.mysql.com/doc/refman/5.0/en/unnamed-views.html 13.2.8.8. Subqueries in the FROM clause Subqueries are legal in a SELECT statement's FROM clause. The actual syntax is: SELECT ... FROM (subquery) [AS] name ... The [AS] name clause is mandatory, because every table in a FROM clause must have a name. Any columns in the subquery select list must have unique names. You can find this syntax described elsewhere in this manual, where the term used is “derived tables.” "Any columns in the subquery select list must have unique names"