My apologies - I realise this is a pretty common question but I'm having some trouble getting my head around the query I need to use.
I'm essentially trying to copy values from one table to another table, based on querying the second table.
For example, I have those two tables:
+-----------------------------------------------------+
| Table 1 |
+----------+------+----------+------------+-----------+
| UniqueID | name | location | Flavour | Status |
| 723948 | | | Mango | Tried |
| 723948 | | | Orange | Not tried |
| 723948 | | | Strawberry | Tried |
| 2346 | | | Mango | Not tried |
| 2346 | | | Strawberry | Tried |
| 3745 | | | Strawberry | Tried |
| 3745 | | | Mango | Tried |
+----------+------+----------+------------+-----------+
and
+-------------------------------------------+
| Table 2 |
+----------+-----------------+--------------+
| UniqueID | fullname | baselocation |
| 723948 | Steve Stevenson | London |
| 2346 | Mary Marington | New York |
+----------+-----------------+--------------+
I then want the name and location columns in table 1 to be populated based on the UniqueID matching with table 2, so the result would be as follows:
+--------------------------------------------------------------------------------+
| Desired result (Table 1) |
+--------------------------+-----------------+----------+------------+-----------+
| UniqueID | name | location | Flavour | Status |
| 723948 | Steve Stevenson | London | Mango | Tried |
| 723948 | Steve Stevenson | London | Orange | Not tried |
| 723948 | Steve Stevenson | London | Strawberry | Tried |
| 2346 | Mary Marington | New York | Mango | Not tried |
| 2346 | Mary Marington | New York | Strawberry | Tried |
| 3745 | | | Strawberry | Tried |
| 3745 | | | Mango | Tried |
+--------------------------+-----------------+----------+------------+-----------+
I know I should be using something within the lines of UPDATE, SET, FROM then JOIN but I'm not 100% sure what the correct and most accurate/efficient query would be.
Thanks!