instruction: get me the number of patients on main drug prescription who have diagnoses icd9 code e9331.
response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "E9331" AND prescriptions.drug_type = "MAIN"