Re: query syntax to replace column value from another table? Yes, that works perfectly. Thank you!
But what if you need more than one column "replacement" from the same
two tables? If I add some more columns to "people":
mysql> select * from people;
+----+---------------+-------------+--------------+-------------+
| id | name | best_friend | worst_friend | worst_enemy |
+----+---------------+-------------+--------------+-------------+
| 1 | James Robert | 2 | 3 | 4 |
| 2 | Lawrence | 1 | 3 | 4 |
| 3 | Odorless | 2 | 4 | 1 |
| 4 | William Small | 3 | 1 | 2 |
+----+---------------+-------------+--------------+-------------+
4 rows in set (0.00 sec)
mysql> select * from nicknames;
+----+----------+
| id | nickname |
+----+----------+
| 1 | Jim Bob |
| 2 | Screech |
| 3 | Stinky |
| 4 | Tiny |
+----+----------+
4 rows in set (0.00 sec)
If I try to set more than one friend/enemy column equal to
nicknames.id, in order to display the nickname value instead of the ID
number, the query fails. Can you do multiple joins to do this? |