I'm trying to add values to a column in one of my tables and the value should be taken from another table that I have in the database. So let's say I have these two tables:
table1 table2
| ID | in_reason | | ID | ...| in_reason |
| 2 | promotion | | 7 | ...|
| 5 | replacing someone| | 5 | ...|
| 1 | Hired | | 1 | ...|
| 2 | ...|
Notice here that in table2, my in_reason column is empty and I want it to have the in_reasons from table1 where table2.ID is equal to table1.ID like this:
table2
| ID | ...| in_reason |
| 7 | ...|
| 5 | ...| replacing someone
| 1 | ...| Hired
| 2 | ...| promotion