I have a table A where I need to update the value for some rows that contain nulls in a sampling column, based on the value of the corresponding column in another table B.
Table A looks like this:
| id_col | grouping |
|---|---|
| 001 | A |
| 002 | B |
| 003 | NULL |
| 004 | A |
| 005 | NULL |
| 006 | B |
and table B contains:
| id_col | grouping |
|---|---|
| 003 | A |
| 005 | B |
What I want to obtain is to update the grouping column of table A with the grouping in table B, for the matching id_col, which means that, after the query, table A should look like this:
| id_col | grouping |
|---|---|
| 001 | A |
| 002 | B |
| 003 | A |
| 004 | A |
| 005 | B |
| 006 | B |