Consider an user DB2 table, Traffic_Dtl:
Key_col Total_col Group_col
K1 750
K2 130
K3 100
K4 790
K5 500
K6 470
Where group_col is null in all the rows.
I have threshold limit 1000 and individual Count_col value always below 1000 only. I need to group the records and update each group with similar group value in Group_col. So that each group has number of records with sum of count_col is always less than or equal to 1000. For example the outcome of grouping should be:
Key_col Total_col Group_col
K1 750 1
K2 130 1
K3 100 1
K4 790 2
K5 500 3
K6 470 3
Any help in this regard is greatly appreciated.
Thanks.
Key_col Total_col Group_col
K1 750
K2 130
K3 100
K4 790
K5 500
K6 470
Where group_col is null in all the rows.
I have threshold limit 1000 and individual Count_col value always below 1000 only. I need to group the records and update each group with similar group value in Group_col. So that each group has number of records with sum of count_col is always less than or equal to 1000. For example the outcome of grouping should be:
Key_col Total_col Group_col
K1 750 1
K2 130 1
K3 100 1
K4 790 2
K5 500 3
K6 470 3
Any help in this regard is greatly appreciated.
Thanks.