I have two tables A and B;
Table A:
Cust_ID, Col_A, Col_B
1001, 1, 2
1002, 3, 4
1003, 2, 1
1004, 4, 3
Table B:
Col_A_Weight, Col_B_Weight
0.1111111, 0.22222
What we need is a new Table C, where Output = Col_A*Col_A_Weight + Col_B*Col_B_Weight
Table C:
Cust_ID, Output
1001, 1*0.1111111 + 2*0.22222
1002, 3*0.1111111 + 4*0.22222
1003, 2*0.1111111 + 1*0.22222
1004, 4*0.1111111 + 3*0.22222
So that final Table C is
Cust_ID Output
1001, 0.5555511
1002, 1.2222133
1003, 0.4444422
1004, 1.1111044
Given that there are 200 Col_A, Col_B, Col_C, etc and corresponging weight columns, it would be good to not have to hard code these, and instead use a clever join so that the columns are referenced dynamically (given that they correspond across both tables). Since Table B has no Cust_ID field, this makes it a little more trickier.
ID Proyek: 3418469
Tentang proyek
7 proposal
Proyek remot
Aktif 13 tahun yang lalu
Ingin menghasilkan uang?
Keuntungan menawar di Freelancer
Tentukan anggaran dan garis waktu Anda
Dapatkan bayaran atas pekerjaan Anda
Uraikan proposal Anda
Gratis mendaftar dan menawar pekerjaan
7 freelancer menawar dengan rata-rata $45 USD untuk pekerjaan ini