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