select * from (
select ROW_NUMBER()over( order by id) orderid,* from test
) a where a.orderid between 1 and 20