วันนี้ครั้งสุดท้ายที่ผู้ป่วย 6170 ได้รับโฟลีย์เอาท์พุตของปัสสาวะคือเมื่อใด? ไม่จำเป็นต้องใช้ตารางทั้งหมด
when was the last time that patient 6170 got a urine out foley output today?It is not neccessary to use all the tables.
 d_items:  row_id [ number]  itemid [ number]  label [ text]  linksto [ text] 
SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6170)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urine out foley' AND d_items.linksto = 'outputevents') AND DATETIME(outputevents.charttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') ORDER BY outputevents.charttime DESC LIMIT 1