นับจำนวนผู้ป่วยที่เหลือตำแหน่งจำหน่าย โดยอิงจากคำแนะนำทางการแพทย์และรหัสขั้นตอน icd9 คือ 3808 หรือไม่ไม่จำเป็นต้องใช้ตารางทั้งหมด
count the number of patients whose discharge location is left against medical advi and procedure icd9 code is 3808?It is not neccessary to use all the tables.
 demographic:  subject_id [ text]  hadm_id [ text]  name [ text]  marital_status [ text]  age [ text]  dob [ text]  gender [ text]  language [ text]  religion [ text]  admission_type [ text]  days_stay [ text]  insurance [ text]  ethnicity [ text]  expire_flag [ text]  admission_location [ text]  discharge_location [ text]  diagnosis [ text]  dod [ text]  dob_year [ text]  dod_year [ text]  admittime [ text]  dischtime [ text]  admityear [ text] 
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND procedures.icd9_code = "3808"