| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Miroslav Monkevic | Date: | October 4 2007 10:42am |
| Subject: | LIMIT within GROUP BY | ||
| View as plain text | |||
Hello,
MySQL 4.1
I have query:
SELECT SUM(points) as ranking FROM results GROUP BY person_id ORDER BY
ranking DESC
My goal is to sum 7 greatest results for each person.
In more general, my question is: is there a way to limit number of
records within groups in "group by" query.
Thank you!
--
Best regards,
Miroslav Monkevic
| Thread | ||
|---|---|---|
| • LIMIT within GROUP BY | Miroslav Monkevic | 4 Oct |
| • Re: LIMIT within GROUP BY | Baron Schwartz | 4 Oct |
| • Re: LIMIT within GROUP BY | Miroslav Monkevic | 5 Oct |
| • Re: LIMIT within GROUP BY | Baron Schwartz | 5 Oct |
| • Re: LIMIT within GROUP BY | Miroslav Monkevic | 5 Oct |
| • Re: LIMIT within GROUP BY | Peter Brawley | 4 Oct |
