我有4个表,而执行此查询则返回
SELECT * FROM couns_form
加入education_detail
ON couns_form
。form_id
= education_detail
。form_id
加入work_experience
ON {{ 1}}。couns_form
= form_id
。work_experience
加入form_id
ON course_description
。couns_form
= form_id
。{{1} } WHERE course_description
。form_id
='16'
couns_form
我想要一个像
这样的数组的结果form_id
NOw:查询是否可行,或者我必须使用PHP函数完成此操作..帮助谢谢
答案 0 :(得分:0)
您的查询应该是这样的
SELECT * FROM couns_form JOIN education_detail ON couns_form.form_id=education_detail.form_id JOIN work_experience ON couns_form.form_id=work_experience.form_id JOIN course_description ON couns_form.form_id=course_description.form_id WHERE couns_form.form_id = '16' GROUP BY couns_form.form_id
希望这会有所帮助