0
我有一個表,如下查詢SQL合併多個表
書
- idbook
- idapplicant
- idsiteplan
- 日期
申請人
- idapplicant
- name_applicant
- idsiteplan
- 計劃
- iddetail
- idbook
- 名
- 值
如何實現查詢,使之成爲如下
-------------------------------------------------------------------------------
| name_applicant| siteplan| date | detail |
-------------------------------------------------------------------------------
| aaa | tapak1 | 12-12-2013 | name_of_detail_1 : value_of_detail_1 |
| name_of_detail_2 : value_of_detail_2 |
| name_of_detail_3 : value_of_detail_3 |
| name_of_detail_4 : value_of_detail_4 |
-------------------------------------------------------------------------------
| bbb | tapak2 | 13-12-2013 | name_of_detail_1 : value_of_detail_1 |
| name_of_detail_2 : value_of_detail_2 |
| name_of_detail_3 : value_of_detail_3 |
| name_of_detail_4 : value_of_detail_4 |
-------------------------------------------------------------------------------
非常感謝
您還可以翻譯結果列名嗎?謝謝! :) –
谷歌'MySQL加入'並且自己做 – Itay