ก่อนปี 2164 มีผู้ป่วยประเภทเข้ารับฉุกเฉินฉุกเฉินกี่ราย ไม่จำเป็นต้องใช้ทุกตาราง
How many patients with emergency admission type were admitted before 2164?It is not neccessary to use all the tables.
 prescriptions:  subject_id [ text]  hadm_id [ text]  icustay_id [ text]  drug_type [ text]  drug [ text]  formulary_drug_cd [ text]  route [ text]  drug_dose [ text] 
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.admityear < "2164"