select member.* , personnel.name_th ,personnel.personnel_id , sick_leave.sick_leave_id as num_leave_id ,sick_leave.timego as timego,sick_leave.status_leave_id as statusid , sick_leave.status_leave_id,sick_leave.leave_id,leave_types.*
from member, personnel, sick_leave,status_leave,leave_types
where member.id_card = personnel.id_card
and personnel.personnel_id = sick_leave.personnel_id
and leave_types.leave_id = sick_leave.leave_id
UNION
select member.* , personnel.name_th ,personnel.personnel_id , personal_leave.personal_leave,personal_leave.timego,personal_leave.status_leave_id, personal_leave.status_leave_id,personal_leave.leave_id,leave_types.*
from member, personnel, personal_leave,status_leave,leave_types
where member.id_card = personnel.id_card
and personnel.personnel_id = personal_leave.personnel_id
and leave_types.leave_id = personal_leave.leave_id
UNION
select member.* , personnel.name_th ,personnel.personnel_id , vacation_leave.vacation_leave, vacation_leave.timego,vacation_leave.status_leave_id, vacation_leave.status_leave_id,vacation_leave.leave_id,leave_types.*
from member, personnel, vacation_leave,status_leave,leave_types
where member.id_card = personnel.id_card
and personnel.personnel_id = vacation_leave.personnel_id
and leave_types.leave_id = vacation_leave.leave_id
UNION
select member.* , personnel.name_th ,personnel.personnel_id , other_leave.other_id, other_leave.timego,other_leave.status_leave_id, other_leave.status_leave_id,other_leave.leave_id,leave_types.*
from member, personnel, other_leave,status_leave,leave_types
where member.id_card = personnel.id_card
and personnel.personnel_id = other_leave.personnel_id
and leave_types.leave_id = other_leave.leave_id
order by sick_leave.sick_leave_id
ช่วยแนะนำทีคะ ว่าถ้าจะกำหนดให้แสดงเฉพาะ
and leave_types.leave_id = '1'