Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to select data in batches.

2652054Dec 27 2017 — edited Dec 28 2017

Hi Experts,

i have to process  customer data in batches of 10k records. The table has two columns RECORD_ID (PRIMARY_KEY) and ORGANIZATION_NUMBER.

There can be multiple customer records under one organization number with different record id.

So when i Select the records for the first batch how can make sure the the ORGANIZATION_NUMBER do split between the batches , i.e., if there are 20k record for 4 ORGANIZATION_NUMBER each having 5k customers

ORG_NUMBER     COUNT

12345                         5000

123456                       5000

1234567                     5000

1234568                     5000

, then the first batch should only contain records from first 2 organization and next batch should contain records from next two organizations.

Is it possible to achieve this functionality via a SQL query if yes what is the best approach ?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 25 2018
Added on Dec 27 2017
11 comments
5,611 views