คนไข้ 035-3162 แพ้ยาอะไรบ้างจนกระทั่ง 2 เดือนที่แล้ว?ไม่จำเป็นต้องใช้ทุกโต๊ะเลย
what were the medications patient 035-3162 was allergic to until 2 months ago?It is not neccessary to use all the tables.
 vitalperiodic:  vitalperiodicid [ number]  patientunitstayid [ number]  temperature [ number]  sao2 [ number]  heartrate [ number]  respiration [ number]  systemicsystolic [ number]  systemicdiastolic [ number]  systemicmean [ number]  observationtime [ time] 
SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-3162')) AND DATETIME(allergy.allergytime) <= DATETIME(CURRENT_TIME(), '-2 month')