I have been given a leaderboard, I need to return the row correspond to 4th to 8th rank in a leaderboard?
id name score
1 gongy 3001
2 urandom 2401
3 eduardische 2477
4 Gassa 2999
5 bcc32 2658
6 Alex_2oo8 6000
7 mirosuaf 2479
8 Sparik 2399
9 thomas_holmes 2478
The query I have is not being accepted
select b.name from
(
select a.name as name ,a.score as score from
(
select name,score from leaderboard order by score desc limit 8
)a
order by a.score
limit 5
) b
order by b.score desc;
2
Answers
May be something like this ?
You can use LIMIT OFFSET
https://dbfiddle.uk/Ys-3jC4L
Above query skips the first 4 rows and limit the result to 4 make it from 4th to 8th