นับจำนวนผู้ป่วยที่ได้รับการวินิจฉัยว่าเป็นโรคข้ออักเสบติดเชื้อและไม่กลับมาโรงพยาบาลภายใน 2 เดือน จนถึงปี 2102 ไม่จำเป็นที่จะต้องใช้โต๊ะทั้งหมด
count the number of patients who were diagnosed with septic arthritis and didn't return to the hospital within 2 months until 2102.It is not neccessary to use all the tables.
 diagnosis:  diagnosisid [ number]  patientunitstayid [ number]  diagnosisname [ text]  diagnosistime [ time]  icd9code [ text] 
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'septic arthritis' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2102') 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 = 'septic arthritis' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2102') AS t2 JOIN patient ON t2.uniquepid = patient.uniquepid WHERE t2.diagnosistime < patient.hospitaladmittime AND STRFTIME('%y', patient.hospitaladmittime) <= '2102' AND DATETIME(patient.hospitaladmittime) BETWEEN DATETIME(t2.diagnosistime) AND DATETIME(t2.diagnosistime, '+2 month'))