我的数据库中有两个 mySQL 表
训练:
+-------------+------------+------------+------------+-...-+------------+
| Training_ID | 09-06-2012 | 16-06-2012 | 23-06-2012 | ... | 28-12-2013 |
+-------------+------------+------------+------------+-...-+------------+
| 1 | 123 | 924 | 367 | | 679 |
+-------------+------------+------------+------------+-...-+------------+
| 2 | 243 | 626 | 381 | | 771 |
+-------------+------------+------------+------------+-...-+------------+
| 3 | 766 | 826 | 956 | | 725 |
+-------------+------------+------------+------------+-...-+------------+
用户:
+---------+----------+
| User_ID | Name |
+---------+----------+
| 123 | Fred |
+---------+----------+
| 924 | James |
+---------+----------+
| 367 | Tim |
+---------+----------+
| 766 | Mark |
+---------+----------+
我想展示的是:
+-------------+------------+-------------+------------+-...-+------------+
| Training_ID | 09-06-2012 | 16-06-2012 | 23-06-2012 | ... | 28-12-2013 |
+-------------+------------+-------------+------------+-...-+------------+
| 1 | 123 - Fred | 924 - James | 367 - Tim | | 679 - Ben |
+-------------+------------+-------------+------------+-...-+------------+
| 2 | 243 - Sarah| 626 - Smith | 381 - Exam | | 771 - John |
+-------------+------------+-------------+------------+-...-+------------+
| 3 | 766 - Mark | 826 - Jone | 956 - Case | | 725 - Brett|
+-------------+------------+-------------+------------+-...-+------------+
注意:实际上有 70 列(格式与上述相同)。
我尝试使用连接 - 但我不能为每一列做一个。
有没有办法将连接应用于整个表?