ตัวอย่างการทดสอบสามตัวอย่างที่ให้บ่อยที่สุดแก่ผู้ป่วยที่เคยได้รับการวินิจฉัยว่าเป็นโรคเยื่อหุ้มหัวใจอักเสบจากการหดตัวในการไปโรงพยาบาลครั้งเดียวกันในปีที่แล้วคืออะไร? ไม่จำเป็นต้องใช้ตารางทั้งหมด
what were the three specimen tests that were most frequently given to patients that were previously diagnosed with constrictiv pericarditis within the same hospital visit the last year?It is not neccessary to use all the tables.
 chartevents:  row_id [ number]  subject_id [ number]  hadm_id [ number]  icustay_id [ number]  itemid [ number]  charttime [ time]  valuenum [ number]  valueuom [ text] 
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id 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 = 'constrictiv pericarditis') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, microbiologyevents.spec_type_desc, microbiologyevents.charttime, admissions.hadm_id FROM microbiologyevents JOIN admissions ON microbiologyevents.hadm_id = admissions.hadm_id WHERE DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND t1.hadm_id = t2.hadm_id GROUP BY t2.spec_type_desc) AS t3 WHERE t3.c1 <= 3