ยาอะไรที่กำหนดให้กับผู้ป่วย 013-27480 ในวันเดียวกันหลังจากใช้ยาปฏิชีวนะ - ขั้นตอน macrolide เมื่อมาโรงพยาบาลครั้งแรก?ไม่จำเป็นต้องใช้ตารางทั้งหมด
what drug was prescribed to patient 013-27480 in the same day after the antibiotics - macrolide procedure when they came to the hospital first time?It is not neccessary to use all the tables.
 microlab:  microlabid [ number]  patientunitstayid [ number]  culturesite [ text]  organism [ text]  culturetakentime [ time] 
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-27480' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND treatment.treatmentname = 'antibiotics - macrolide') AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-27480' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1)) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.drugstarttime AND DATETIME(t1.treatmenttime, 'start of day') = DATETIME(t2.drugstarttime, 'start of day')