I have 2 tables
Product FiledName Value
AA color red
AA price 10.2
AA ID X1
BB Color Blue
BB price 20.2
BB ID X2
second table
ID Code
X1 123A
X2 123B
I need to populate the third table with the following information from the previous tables
Code FiledName Value
123A color red
123A price 10.2
123B color red
123B price 20.2
What's the easiest way to do this?