Bug #29606 | LAST ENTRY of a GROUP BY sql statement | ||
---|---|---|---|
Submitted: | 6 Jul 2007 18:57 | Modified: | 20 Jul 2009 9:44 |
Reporter: | numpsy beelzebub | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: General | Severity: | S4 (Feature request) |
Version: | 5.1 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | GROUP BY, last, LAST VALUE |
[6 Jul 2007 18:57]
numpsy beelzebub
[20 Jul 2009 9:44]
Susanne Ebrecht
Many thanks for writing a feature request. Unfortunately, this is not a bug because you are already able to use ORDER BY here: http://dev.mysql.com/doc/refman/5.1/en/order-by-optimization.html
[24 Jul 2009 3:12]
John Chew
Was this bug really fixed in 5.1? In 5.0.45, even if you specify ORDER BY a column, if you select that column in a GROUP BY, the value you get is the one in the first row.
[24 Jul 2009 3:19]
John Chew
I think if you number your records, you can use the approach in http://dev.mysql.com/doc/refman/5.0/en/example-maximum-column-group-row.html to answer the original question.