我只想从'list'表中显示行。但是下面的代码也提供了来自父表的行值
mysqli_query($con, "select * from list
RIGHT JOIN department ON list.department_id = department.id
RIGHT JOIN subject ON list.subject_id = subject_id
RIGHT JOIN sub_subject ON list.sub_subject_id = sub_subject_id
order by list.id $order");
答案 0 :(得分:1)
mysqli_query($con, "select list.* from list
Left JOIN department ON list.department_id = department.id
Left JOIN subject ON list.subject_id = subject_id
Left JOIN sub_subject ON list.sub_subject_id = sub_subject_id
Where department.id = NULL
And subject_id = NULL
And sub_subject_id = NULL
order by list.id $order");