Bug #2898 | Unexpected result: max() with group by | ||
---|---|---|---|
Submitted: | 20 Feb 2004 0:21 | Modified: | 20 Feb 2004 12:11 |
Reporter: | Kevin Leung | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 4.1.1-alpha | OS: | FreeBSD (FreeBSD 4.9-STABLE) |
Assigned to: | Dean Ellis | CPU Architecture: | Any |
[20 Feb 2004 0:21]
Kevin Leung
[20 Feb 2004 12:11]
Dean Ellis
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.mysql.com/documentation/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php Additional info: MySQL extends GROUP BY to allow you to SELECT columns that are not part of the GROUP BY and are not used in aggregate functions, but this comes with the side-effect that you have no control over which row is used to produce the values for those columns when there is more than one row which could provide the value. See: http://www.mysql.com/doc/en/GROUP-BY-hidden-fields.htm You can sidestep this with subqueries and such...