MySQL Forums
Forum List  »  German

Re: MAX von SUM
Posted by: J?rg B?chner
Date: August 04, 2011 08:08AM

Wenn's nichts Eleganteres gibt, hätte ich zumindest eine Lösung ganz ohne MAX:

SELECT name FROM
(SELECT name, SUM(wert) AS w FROM tbl WHERE wert>0 GROUP BY name) AS s
ORDER BY w DESC LIMIT 1

Options: ReplyQuote


Subject
Views
Written By
Posted
2047
August 04, 2011 06:18AM
Re: MAX von SUM
1116
August 04, 2011 08:08AM


Sorry, you can't reply to this topic. It has been closed.

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.