with y as ( select version, Id , row_number() over (order by Id,version) r from X ) select Id, version from y where r>20 and r<30
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)