我想计算当前未入院的患者人数(CurrentClinicalInfo = 'False'
)。ClinicalInfo
但是,每个患者有多个s。所以我需要区别对待。
我在下面尝试过这段代码,但它带有太多的列,导致进一步的错误。
SELECT DISTINCT COUNT(*) AS TableLength
FROM PatientDemographics AS p LEFT OUTER JOIN
PatientClinicalinformation AS pc ON p.PatientID = pc.PatientID
WHERE (pc.PatientID IS NULL) AND (p.FirstName LIKE '%' + + '%') OR
(pc.PatientID IS NULL) AND (p.Surname LIKE '%' + + '%') OR
(p.FirstName LIKE '%' + + '%') AND (pc.CurrentClinicalInfo = 'False') OR
(p.Surname LIKE '%' + + '%
') AND (pc.CurrentClinicalInfo = 'False')