instruction: count the number of times that patient 1862 was prescribed pantoprazole until 2 years ago.
response: SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1862) AND prescriptions.drug = 'pantoprazole' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-2 year')