So I have two tables, one with a key and one with rawdata
Key:
| ID | Zone |
|---|---|
| 1 | A |
| 2 | B |
| 3 | c |
Raw Data:
| ID | DesignatedZone |
|---|---|
| 1 | |
| 2 | |
| 2 | |
| 1 | |
| 3 |
I want to fill the empty column in rawdata if the value in the ID columns match.
Desired Output:
| ID | DesignatedZone |
|---|---|
| 1 | A |
| 2 | B |
| 2 | B |
| 1 | A |
| 3 | C |
Raw Data has 1000+ rows. Would a JOIN be the best way to tackle it or UPDATE? Im also open to an Excel solution as well since I can edit the data before I import it.
This was my guess:
UPDATE rawdata
SET rawdata.DesignatedZone = key.Zone
WHERE rawdata.ID = key.ID