select * from(select *,row_number()over(order by ProductID) as num from Products) as t where t.num>10 and t.num<30