จนถึง 2 ปีที่แล้ว อะไรคือการวินิจฉัยที่พบบ่อยที่สุดห้าอันดับแรกที่ผู้ป่วยได้รับในเดือนเดียวกันหลังจากการวินิจฉัยโรคอัมพาต agitans? ไม่จำเป็นที่จะต้องใช้ตารางทั้งหมด
until 2 years ago what are the top five most common diagnoses that patients were given in the same month after diagnosis of paralysis agitans?It is not neccessary to use all the tables.
 icustays:  row_id [ number]  subject_id [ number]  hadm_id [ number]  icustay_id [ number]  first_careunit [ text]  last_careunit [ text]  first_wardid [ number]  last_wardid [ number]  intime [ time]  outtime [ time] 
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'paralysis agitans') AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-2 year')) AS t1 JOIN (SELECT admissions.subject_id, diagnoses_icd.icd9_code, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-2 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME(t1.charttime, 'start of month') = DATETIME(t2.charttime, 'start of month') GROUP BY t2.icd9_code) AS t3 WHERE t3.c1 <= 5)