我想加入 3 个空值的表,
这里我有 3 个表如下
tbl_reporting tbl_criteria tbl_student
|===============================| |========================| |===============|
| id | id_criteria | id_student | | id | name |weight | | id | name |
|===============================| |========================| |===============|
| 1 | 2 | 3 | | 1 | worrying | 3 | | 1 | Nina |
| 2 | 1 | 2 | | 2 | naughty | 2 | | 2 | Adam |
| 3 | 1 | 1 | | 3 | usually | 2 | | 3 | Dodi |
| 4 | 2 | 2 | | 4 | good | 1 | | 4 | Zarah |
| 5 | 1 | 1 | | 5 | obey | 1 | | 5 | Udep |
和我想要的结果,像这样
result
| id | student_name | criteria_name | weight |
|==============================================|
| 1 | Dodi | naughty | 2 |
| 2 | Adam | worrying | 3 |
| 3 | Nina | worrying | 3 |
| 4 | Adam | naughty | 2 |
| 5 | Nina | worrying | 3 |
|NULL| Zarah | NULL | 0 |
|NULL| Udep | NULL | 0 |
|NULL| NULL | usualy | 0 |
|NULL| NULL | good | 0 |
|NULL| NULL | obey | 0 |
我尝试自己..但不是我所期望的。我在这里编码自我:链接
谢谢