ในผู้ป่วยที่ได้รับยา metoprolol tartrate ขนาด 25 มก. หลังจากได้รับการวินิจฉัยว่าเป็นโรคตับอ่อนอักเสบ - ด้วยการสร้างถุงน้ำเทียม คำนวณอัตราการรอดชีวิตสามปี ไม่จำเป็นต้องใช้ตารางทั้งหมด
among patients who were prescribed metoprolol tartrate 25 mg tablet after having been diagnosed with pancreatitis - with pseudocyst formation calculate the three year survival rate.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 SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pancreatitis - with pseudocyst formation' GROUP BY patient.uniquepid HAVING MIN(diagnosis.diagnosistime) = diagnosis.diagnosistime) AS t1) AS t2 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'metoprolol tartrate 25 mg tablet') AS t3 ON t2.uniquepid = t3.uniquepid WHERE t2.diagnosistime < t3.drugstarttime) AS t4 JOIN patient ON t4.uniquepid = patient.uniquepid