Table Name : Hist_table
Shp_cd wt_grp net_wt tot_wt
101 10 9 7
102 20 8 2
103 15 4 1
Factor_table
Fact_id fact_column factor
1 wt_grp 2
2 net_wt 5
3 tot_wt 3
Note – this factor table contains rows as the column name of hist_table.
Now we have to update the Hist_table with the multiplied with the factors
For example wt_grp factor is 2 then we have to update all the wt_grp column of hist table as Hist_table.wt_grp * factor_table.factor
So the result should be
shpcd wt_grp net_wt tot_wt
101 20 45 21
102 40 40 6
103 30 20 3