J
jsccorps
For three vendors (A, B, C), need to find minimum price based on Product ID
(PID). For same price, use VID A’s price.
Before:
VID PID Price
A 1 9.88
B 1 8.33
C 1 7.87
A 3 2.79
B 3 4.89
C 5 12.87
A 5 14.31
B 5 5.36
B 8 14.73
A 8 14.73
C 8 14.73
A 9 2.22
C 10 3.33
B 11 4.44
After:
VID PID Price
C 1 7.87
A 3 2.79
B 5 5.36
A 8 14.73
A A 2.22
C B 3.33
B B 4.44
(PID). For same price, use VID A’s price.
Before:
VID PID Price
A 1 9.88
B 1 8.33
C 1 7.87
A 3 2.79
B 3 4.89
C 5 12.87
A 5 14.31
B 5 5.36
B 8 14.73
A 8 14.73
C 8 14.73
A 9 2.22
C 10 3.33
B 11 4.44
After:
VID PID Price
C 1 7.87
A 3 2.79
B 5 5.36
A 8 14.73
A A 2.22
C B 3.33
B B 4.44