นับจำนวนผู้ป่วยที่ได้รับการวินิจฉัยว่ามีอาการหายใจลำบากเฉียบพลันและไม่กลับมาโรงพยาบาลภายใน 2 เดือน ในปี พ.ศ. 2105 ไม่จำเป็นต้องใช้โต๊ะทั้งหมด
count the numbers of patients who were diagnosed with acute respiratory distress and did not come back to the hospital within 2 months in 2105.It is not neccessary to use all the tables.
 treatment:  treatmentid [ number]  patientunitstayid [ number]  treatmentname [ text]  treatmenttime [ time] 
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory distress' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t1) - (SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory distress' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t2 JOIN patient ON t2.uniquepid = patient.uniquepid WHERE t2.diagnosistime < patient.hospitaladmittime AND STRFTIME('%y', patient.hospitaladmittime) = '2105' AND DATETIME(patient.hospitaladmittime) BETWEEN DATETIME(t2.diagnosistime) AND DATETIME(t2.diagnosistime, '+2 month'))