Given this MYSQL table of images i want the best rated records for each day.
id created_at rateScore
--------------------------------------
1 2014-06-16 12:30:00 100
2 2014-06-16 13:30:00 200
3 2014-06-16 14:30:00 50
4 2014-06-16 15:30:00 20
5 2014-06-16 16:30:00 0
6 2014-06-17 14:30:00 100
7 2014-06-17 14:31:00 90
8 2014-06-18 14:31:00 100
Expected result: Show only the 3 best rated images for each day.
id created_at rateScore
--------------------------------------
1 2014-06-16 12:30:00 100
2 2014-06-16 13:30:00 200
3 2014-06-16 14:30:00 50
6 2014-06-17 14:30:00 100
7 2014-06-17 14:31:00 90
8 2014-06-18 14:31:00 100
I tried a lot with sub selects etc. but i'm starting to become frustrated. The problem seems easy but is hard to solve for me. Maybe someone has a hint how to solve this.
Thanks in advance and have a nice day