--------------------------------------------------
ID | ServiceID | Name | Lastname |
--------------------------------------------------
1 00001 Paul Gilbert
SELECT
s.ServiceID, s.Name, s.Lastname,
r.Repair_Symptom, r.Repair_Price
FROM tblRepairCase c
left join tblRepairSytom r ON r.ID_Repair = c.ID_Repair
left join tblService s ON s.ServiceID = c.ServiceID
SELECT
s.ServiceID, s.Name, s.Lastname,
r.Repair_Symptom, r.Repair_Price
FROM tblRepartCase c
left join tblRepairSytom r ON r.ID_Repair = c.ID_Repair
left join tblCourse s ON s.ServiceID = c.ServiceID
จากที่ผม TEST คำสั่งดั่งกลาวผลลัพธ์ที่ได้เป็นแบบนี้
SELECT
s.ServiceID, s.Name, s.Lastname,
r.Repair_Symptom, r.Repair_Price
FROM tblRepairSytom c
left join tblRepairCase r ON r.ID_Repair = c.ID_Repair
left join tblService s ON s.ServiceID = c.ServiceID
SELECT
b.ServiceID,
c.Name,
c.LastName,
a.Repair_Symptom,
a.Repair_Price
FROM tblRepairSytom a
left join tblRepairCase b on a.ServiceID = b.ServiceID
left join tblService c on b.ID_Repair = c.ID