Se mitt andra svar för lösningen endast för MySQL, men mycket snabb.
Denna lösning låter dig specificera valfritt antal översta rader per fil och använder ingen MySQL "funky" syntax - den bör köras på de flesta databaser.
select lane, series
from lane_series ls
group by lane, series
having (
select count(*)
from lane_series
where lane = ls.lane
and series > ls.series) < 2 -- Here's where you specify the number of top rows
order by lane, series desc;
Testutgång:
create table lane_series (lane int, series int);
insert into lane_series values
(1, 680),
(1, 685),
(1, 688),
(2, 666),
(2, 425),
(2, 775);
select lane, series
from lane_series ls
group by lane, series
having (select count(*) from lane_series where lane = ls.lane and series > ls.series) < 2
order by lane, series desc;
+------+--------+
| lane | series |
+------+--------+
| 1 | 688 |
| 1 | 685 |
| 2 | 775 |
| 2 | 666 |
+------+--------+
4 rows in set (0.00 sec)