ในการเยี่ยมหอผู้ป่วยหนักครั้งแรก ครั้งสุดท้ายที่ผู้ป่วย 021-198501 มีเอาท์พุต y (มล.) - ท่ออก y - a #1 ด้านขวา b #4 เอาท์พุตด้านซ้ายคือเมื่อใด? ไม่จำเป็นต้องใช้ทั้งหมด ตาราง
on the first intensive care unit visit, when was the last time that patient 021-198501 had a output y (ml)-chest tube y - a #1 right lateral b #4 left lateral output?It is not neccessary to use all the tables.
 patient:  uniquepid [ text]  patienthealthsystemstayid [ number]  patientunitstayid [ number]  gender [ text]  age [ text]  ethnicity [ text]  hospitalid [ number]  wardid [ number]  admissionheight [ number]  admissionweight [ number]  dischargeweight [ number]  hospitaladmittime [ time]  hospitaladmitsource [ text]  unitadmittime [ time]  unitdischargetime [ time]  hospitaldischargetime [ time]  hospitaldischargestatus [ text] 
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-198501') AND NOT patient.unitdischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'output y (ml)-chest tube y - a #1 right lateral b #4 left lateral' ORDER BY intakeoutput.intakeoutputtime DESC LIMIT 1