ผู้ป่วย 006-245995 แพ้ยาอะไรในปี 07/ปีที่แล้ว?ไม่จำเป็นต้องใช้ทุกตาราง
what drug is patient 006-245995 allergic to in 07/last year?It is not neccessary to use all the tables.
 microlab:  microlabid [ number]  patientunitstayid [ number]  culturesite [ text]  organism [ text]  culturetakentime [ 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 = '006-245995')) AND DATETIME(allergy.allergytime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', allergy.allergytime) = '07'