help me in building a sql query that returns the 1st and 1000th record...
ManjitJul 6 2009 — edited Jul 6 2009I have a EMP table
EMP
emp_id
emp_name
I want to process the entire table in group of 1000 records .That is 1000 records at a timee.
In short in PL-SQL I want to process the 1-1000 emp ids ,then the 1001-2000 emp_ids etc.
Can some one help me building a select query that will returm me records in this fashion
first_emp_id/last_emp_id
1 /1000
1001 /2000
2001 /3000
.
.
.
This way I can grab the first record suply my pl-sql batch the two starting and ending ids and let the batch process it.
I am planning to using dbms_job to run 10 batch at a time,each job will be supplied with the starting and endings ids.