จนถึงปี 2103 ยาสี่ชนิดที่ต้องสั่งจ่ายบ่อยที่สุดสำหรับผู้ป่วยที่ได้รับยามิดาโซแลม (รอบรู้) 2 มก./2 มล. ฉีด 1 มก. ในเวลาเดียวกัน? ไม่จำเป็นต้องใช้ตารางทั้งหมด
until 2103 what are the four most frequently prescribed medications for patients who were also prescribed midazolam (versed) 2 mg/2ml inj 1 mg at the same time?It is not neccessary to use all the tables.
 lab:  labid [ number]  patientunitstayid [ number]  labname [ text]  labresult [ number]  labresulttime [ time] 
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'midazolam (versed) 2 mg/2ml inj 1 mg' AND STRFTIME('%y', medication.drugstarttime) <= '2103') AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', medication.drugstarttime) <= '2103') AS t2 ON t1.uniquepid = t2.uniquepid WHERE DATETIME(t1.drugstarttime) = DATETIME(t2.drugstarttime) GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 4