อะไรคือความแตกต่างระหว่างเอาต์พุตทั้งหมดและจำนวนอินพุตสำหรับผู้ป่วย 017-20711 ในเดือน/16 ที่แล้ว?ไม่จำเป็นต้องใช้ตารางทั้งหมด
what's the difference between the total output and the amount of input for patient 017-20711 on last month/16?It is not neccessary to use all the tables.
 vitalperiodic:  vitalperiodicid [ number]  patientunitstayid [ number]  temperature [ number]  sao2 [ number]  heartrate [ number]  respiration [ number]  systemicsystolic [ number]  systemicdiastolic [ number]  systemicmean [ number]  observationtime [ time] 
SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-20711')) AND intakeoutput.cellpath LIKE '%intake%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') AND STRFTIME('%d', intakeoutput.intakeoutputtime) = '16') - (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-20711')) AND intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') AND STRFTIME('%d', intakeoutput.intakeoutputtime) = '16')