sql - Get 1000 row set from Oracle table -
this question has answer here:
- sql (oracle): order , limit 1 answer
i want select 1000 rows @ time using query:
select * memberid_1m rownum <1000
how next set of 1000 rows table in loop?
i suggest use row_number()
function this: (my id
pk)
select m.* ( select memberid_1m.*, row_number() on (order id) rn memberid_1m ) m (rn <= 1000)
and next:
select m.* ( select memberid_1m.*, row_number() on (order id) rn memberid_1m ) m (rn > 1000) , (rn <= 2000)
for page :i
:
select m.* ( select memberid_1m.*, row_number() on (order id) rn memberid_1m ) m (rn > :i * 1000) , (rn <= (:i + 1) * 1000)
Comments
Post a Comment