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.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.041 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.