slim7
asked on
Rownum and Order by
We have a nightly batch process that sqlldr records into a staging table. When we process the file, we break up the file into chunks i.e. 1000 records at a time. so our query looks like 'select * from stg where rownum < 1000 order by account_number'.
On occasion the process will skip rows, i.e. it will process 1-150, skip 50 records, and then continue 200-999. What causes this?
On occasion the process will skip rows, i.e. it will process 1-150, skip 50 records, and then continue 200-999. What causes this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
so, rewrite the query:
--------------------------
select * from
(
select * from stg where order by account_number
)stg_ordered
where rownum < 1000;
--------------------------