Sample Header Ad - 728x90

mysql Quiz leaderboard filter by points, time taken

0 votes
1 answer
313 views
I have a quiz report table which shows a report for every quiz a user takes. I need to create a leaderboard from this, which shows the top users best score, filtering by points and then time taken. here is a link to a sql fiddle http://sqlfiddle.com/#!2/65fbf0/1 I am really struggling as i need to filter the results by two columns for one user, my ideal result would be Results for Quiz id 1 --------------------------------------------------------------- | user_id | points | time_spend | start_dt | quiz_id | | 1 | 3 | 0.5 | May,15 2015| 1 | | 2 | 3 | 0.8 | May,15 2015| 1 | | 3 | 2 | 0.5 | May,15 2015| 1 | Then a separate query for all quiz's showing the results from the last week. Results from all Quizzs --------------------------------------------------------------- | user_id | points | time_spend | start_dt | quiz_id | | 1 | 3 | 0.5 | May,15 2015| 1 | | 2 | 3 | 0.8 | May,13 2015| 3 | | 3 | 2 | 0.5 | May,12 2015| 2 |
Asked by Gismmo (101 rep)
May 26, 2015, 11:09 PM
Last activity: Apr 26, 2025, 03:04 AM