我正在尝试“连接”单行中多行的描述。
我有这些表:
tb_employees:
+---------------+---------------+
| id_employee | employee |
+---------------+---------------+
| 1 | Robert Tomson |
| 2 | Jhonatan Weg |
| 3 | Eva Uhte |
+---------------+---------------+
tb_要求:
+---------------+-----------------+
| id_requirem | requirem |
+---------------+-----------------+
| 11 | Photo |
| 12 | Criminal Record |
| 13 | Shooting Test |
+---------------+-----------------+
tb_详细信息:
+-----------------+---------------------+-------------------------+
| id_detail | id_employee | id_requirem |
+-----------------+---------------------+-------------------------+
| 1 | 1 | 11 |
| 2 | 1 | 12 |
| 3 | 1 | 13 |
| 4 | 2 | 11 |
| 5 | 2 | 13 |
| 6 | 3 | 12 |
| 7 | 3 | 13 |
+-----------------+---------------------+-------------------------+
我必须SELECT query
像这样显示:
+-------------------------+----------------------------------------+
| employee | requirem |
+-------------------------+----------------------------------------+
| Robert Tomson | Photo - Criminal Record - Shooting Test|
| Jhonatan Weg | Photo - Shooting Test |
| Eva Uhte | Criminal Record - Shooting Test |
+-------------------------+----------------------------------------+
老实说,我真的不知道怎么做:S
有任何想法吗?谢谢你的答案。