อะไรคือความแตกต่างระหว่างอินพุตทั้งหมดและเอาต์พุตรวมของผู้ป่วย 19412 เมื่อวานนี้? ไม่จำเป็นต้องใช้ตารางทั้งหมด
what was the difference between the total input and the total output of patient 19412 in yesterday?It is not neccessary to use all the tables.
 patients:  row_id [ number]  subject_id [ number]  gender [ text]  dob [ time]  dod [ time] 
SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19412)) AND DATETIME(inputevents_cv.charttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-1 day')) - (SELECT SUM(outputevents.value) 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 = 19412)) AND DATETIME(outputevents.charttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-1 day'))