select *from (select *,row_number()over(order by ID desc) as row from t_test where id < 5000)twhere row<=100