有人可以帮我在此查询中添加第三个表,其中包含疾病的风险因素。该表是 tblRiskFactors
SELECT tblDiseases.disease
FROM tblRel
LEFT JOIN tblDiseases ON tblRel.diseaseID = tblDiseases.diseaseID
WHERE tblRel.symptomID = '1' AND tblRel.symptomID = '2' AND tblRel.symptomID ='3'
有人可以帮我在此查询中添加第三个表,其中包含疾病的风险因素。该表是 tblRiskFactors
SELECT tblDiseases.disease
FROM tblRel
LEFT JOIN tblDiseases ON tblRel.diseaseID = tblDiseases.diseaseID
WHERE tblRel.symptomID = '1' AND tblRel.symptomID = '2' AND tblRel.symptomID ='3'
SELECT tblDiseases.disease
FROM tblRel
LEFT JOIN tblDiseases
ON tblRel.diseaseID = tblDiseases.diseaseID
LEFT JOIN tblRiskFactors
ON -- define the linking condition here
WHERE tblRel.symptomID = '1' AND
tblRel.symptomID = '2' AND
tblRel.symptomID = '3'
要进一步了解有关联接的更多信息,请访问以下链接:
SELECT tblDiseases.disease as disease
FROM tblRel
LEFT JOIN tblDiseases ON tblRel.diseaseID = tblDiseases.diseaseID
LEFT JOIN tblRiskFactors ON tblRel.relation_column = tblRiskFactors.relation_column
WHERE tblRel.symptomID in (1,2,3)