Bug #44839 | correlated subquery fails with error 1054. | ||
---|---|---|---|
Submitted: | 13 May 2009 5:06 | Modified: | 13 May 2009 6:39 |
Reporter: | Shine Mathew | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Parser | Severity: | S2 (Serious) |
Version: | 5.1.31 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | correlated subqery, error 1054, Having clause with correlated column name |
[13 May 2009 5:06]
Shine Mathew
[13 May 2009 6:39]
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 According to http://dev.mysql.com/doc/refman/5.1/en/select.html: The SQL standard requires that HAVING must reference only columns in the GROUP BY clause or columns used in aggregate functions. However, MySQL supports an extension to this behavior, and allows HAVING to refer to columns in the SELECT list and columns in outer subqueries as well. There is no column 't8.i3' in the SELECT list, this is the reason why you get "1054: Unknown column 't8.i3' in 'having clause'" error.