1

有人可以帮我在此查询中添加第三个表,其中包含疾病的风险因素。该表是 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'
4

2 回答 2

0
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'

要进一步了解有关联接的更多信息,请访问以下链接:

于 2013-03-01T08:44:26.347 回答
0
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)
于 2013-03-01T08:47:42.147 回答