select surname, code, position as pos, row_number() over (order by fastestlapspeed ::numeric) as fast, ntile(3) over w as "group", lag