นับจำนวนคนไข้ที่เคยทำหัตถการ loc exc bone lesion สองครั้งขึ้นไป จนถึงปี 2104 ไม่จำเป็นที่จะต้องใช้ตารางทั้งหมด
count the number of patients who had had a loc exc bone lesion nec procedure done two or more times until 2104.It is not neccessary to use all the tables.
 d_icd_diagnoses:  row_id [ number]  icd9_code [ text]  short_title [ text]  long_title [ 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 = 'loc exc bone lesion nec') AND STRFTIME('%y', procedures_icd.charttime) <= '2104' GROUP BY admissions.subject_id) AS t1 WHERE t1.c1 >= 2