select* from(select *,row_number() over(order by code) as rownumberfrom table)as tempwhere rownumber between 10 and 20