นับจำนวนผู้ป่วยที่ได้รับขั้นตอนการถ่ายเซลล์แบบแพ็คในเดือนเดียวกัน หลังจากได้รับการผ่าตัดต่อเนื่อง 96+ ชม. จนถึง 21.00 น. ไม่จำเป็นต้องใช้ตารางทั้งหมด
count the number of patients who received packed cell transfusion procedure during the same month after having received cont inv mec ven 96+ hrs procedure until 2100.It is not neccessary to use all the tables.
 procedures_icd:  row_id [ number]  subject_id [ number]  hadm_id [ number]  icd9_code [ text]  charttime [ time] 
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime 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 = 'cont inv mec ven 96+ hrs') AND STRFTIME('%y', procedures_icd.charttime) <= '2100') AS t1 JOIN (SELECT admissions.subject_id, procedures_icd.charttime 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 = 'packed cell transfusion') AND STRFTIME('%y', procedures_icd.charttime) <= '2100') 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')