รับจำนวนผู้ป่วยที่เข้ารับการรักษาในโรงพยาบาลก่อนปี 2157 ที่ได้วินิจฉัยโรค icd9 รหัส 82022 ไม่จำเป็นต้องใช้ทุกตาราง
Get the number of patients admitted to the hospital before 2157 who had diagnoses icd9 code 82022.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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2157" AND diagnoses.icd9_code = "82022"