นับจำนวนผู้ป่วยที่ได้รับการทำ endo polpectomy lrge int มาแล้ว 2 ครั้งนับตั้งแต่ 2 ปีที่แล้ว ไม่จำเป็นต้องใช้ตารางทั้งหมด
count the number of patients who have already received the endo polpectomy lrge int two times since 2 years ago.It is not neccessary to use all the tables.
 d_items:  row_id [ number]  itemid [ number]  label [ text]  linksto [ text] 
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'endo polpectomy lrge int') AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY admissions.subject_id) AS t1 WHERE t1.c1 = 2