processID
2つのMySQLテーブルを結合して、レポートとして次の出力を取得したいと思います。
table 1: LMProcess
------------------------------------
| ProcessID | LMNo | Status | Dept |
------------------------------------
|1 |1001 |1 |Legal |
|2 |1001 |1 |R&D |
|3 |1001 |1 |D&R |
|4 |1001 |1 |L&M |
|5 |1002 |1 |Legal |
|6 |1002 |1 |R&D |
|7 |1002 |1 |D&R |
|8 |1002 |1 |L&M |
------------------------------------
table 2: Recommendation
-----------------------------------
| ID | ProcessID | Recommendation |
-----------------------------------
| |1 |Yes |
| |2 |No |
| |3 |Yes |
| |4 |Yes |
| |5 |Yes |
| |6 |No |
| |7 |No |
| |8 |Yes |
-----------------------------------
Report: LM File Recommendations by the Departments
----------------------------------
| LMNo | Legal | R&D | D&R | L&M |
----------------------------------
|1001 |Yes |No |Yes |Yes |
|1002 |Yes |No |No |Yes |
----------------------------------