Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I want to create batches for below kind of records.
Wanted To Create Batches In Such a way like, It should split RowID into Batches but FamilyID Should Not Split Across Batches.

+-------+----------+
| RowID | FamilyID |
+-------+----------+
|     1 |     2296 |
|     2 |     2242 |
|     3 |     2247 |
|     4 |     2243 |
|     5 |     2310 |
|     6 |     2310 |
|     7 |     2310 |
|     8 |     2310 |
|     9 |     2311 |
|    10 |     2311 |
+-------+----------+

+--------------+-------+
|    Batch     | Range |
+--------------+-------+
| Batch1       | 1-8   |
| Batch2       | 9-10  |
+--------------+-------+

Note: Records For Same Family Should Not Split To Other Batch.

i.e Single Family Record ex: 2310 in above example should be in one batch only.
Is there any help ? how can i create query for above criteria ?

Thanks
Posted
Updated 3-Aug-14 20:35pm
v2
Comments
Maciej Los 4-Aug-14 2:36am    
Based on what criteria?
Not clear... ;(
niteshgajjar 4-Aug-14 6:31am    
batches will be splited based on Count provided by user..So in this example TotalNoOfRecords To Create Batches is 10 and Let's assume user has asked to Create 2 Batches.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900