直接上代码
SELECT gu.id, gu.school_name, gu.student_no, gu.student_name, gu.id_card, gu.Job_category, gu.actual_employment_unit, gu.specialty, gu.phone, gu.affirm,
gu.labor_contract,gu.diploma, gu.household_file,gu.employment_certificate,
(SELECT guuu.update_content FROM `graduate_unit_update` guuu WHERE guuu.update_type=1 AND gu.`id`=guuu.graduate_unit_id ORDER BY guuu.create_time DESC LIMIT 1)
actualJobCategory,
(SELECT guu.update_content FROM `graduate_unit_update` guu WHERE guu.update_type=0 AND gu.`id`=guu.graduate_unit_id ORDER BY guu.create_time DESC LIMIT 1) effectiveUnit
FROM graduate_unit gu
WHERE gu.affirm=1
HAVING actualJobCategory IS NOT NULL OR effectiveUnit IS NOT NULL
总结:用 HAVING 即可实现