| Bug #12803 | selecting a consistent row of aggrigate data during a group | ||
|---|---|---|---|
| Submitted: | 25 Aug 2005 13:24 | Modified: | 17 Jun 2013 14:31 |
| Reporter: | Are you mortal Then prepare to die. | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server | Severity: | S4 (Feature request) |
| Version: | next | OS: | Any (all) |
| Assigned to: | Matthew Lord | CPU Architecture: | Any |
[25 Aug 2005 13:24]
Are you mortal Then prepare to die.
[14 Jun 2013 17:19]
Matthew Lord
Thank you for the feature request, and for your help in making MySQL even better!
I'm closing this SR for now, as the ROW method wouldn't produce a consistent row any more than the subquery method would, which should now be performant in 5.6 and later:
SELECT article, dealer, price
FROM shop s1
WHERE price=(SELECT MAX(s2.price)
FROM shop s2
WHERE s1.article = s2.article);
If you would simply like the ROW() function added to MySQL, that is similar to the Oracle function, then please let me know and I can open a new Feature Request for that specifically:
http://docs.oracle.com/cd/B28359_01/olap.111/b28126/dml_functions_2072.htm
Thanks again!
[14 Jun 2013 22:03]
Are you mortal Then prepare to die.
The sub-query method isn't guaranteed to return a consistent row of data when there is no unique maximum value when using GROUP BY. That's why I'm suggesting that an alternative syntax is needed.
[17 Jun 2013 14:13]
Matthew Lord
I don't see how the ROW() function would be any different in that regard?
[17 Jun 2013 14:31]
Are you mortal Then prepare to die.
The idea is that it would. That's what I'm proposing.
