I have two tables like this

I would like to insert from Table1 to Table2 here. This is how I want it.
Take MOU = 10. It has num1 and hour1 in the same row. I would like to insert it into the cell that is at the same row as that of num1 and same column as that of hour1.
How could I do that?
Disclaimer: I am not offering any code here because I am unsure of how to write this query. I sure do know to write a simple update. I am a teracota newbie.
This worked.
UPDATE a
FROM table2 a, table1 b
SET hour1=b.mou
WHERE a.access_method_id=b.access_method_id
AND hour='hour1'
Did the same for each hours. Not very elegant. But this is all I could get.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With