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 ?