I need to update table A columns col3, col4, col5 and col6 by table b columns col3, col4, col5 and col6 however table b col5 and col6 values need to come from table c col1. Means table b col5 and col6 have values in it however i need to replace them with value from table c col1 and need to update table a col5 and col6 accordingly. table a and table b has col1 and col2 in common. i am trying something like this.
Update a
a.col3 = b.col3,
a.col4 = b.col4,
a.col5 = (select col1 from table_c c where c.col2=b.col5),
a.col6 = (select col1 from table_c c where c.col2=b.col6)
from table_A a inner join table_b
on a.col1=b.col1 and a.col2=b.col2
can someone help me reframe above update query? thanks in advance for your help.