นับจำนวนผู้ป่วยที่ได้รับยา prmx dexmedetomidine 400mcg/100ml ns หยดภายใน 2 เดือนหลังจากได้รับการวินิจฉัยจนถึงปี 2104 ด้วยอาการเทีย ไม่จำเป็นที่จะต้องใช้ตารางทั้งหมด
count the number of patients for whom prmx dexmedetomidine 400mcg/100ml ns drip was prescribed within 2 months after having been diagnosed until 2104 with tia.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 COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'tia' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'prmx dexmedetomidine 400mcg/100ml ns drip' AND STRFTIME('%y', medication.drugstarttime) <= '2104') AS t2 WHERE t1.diagnosistime < t2.drugstarttime AND DATETIME(t2.drugstarttime) BETWEEN DATETIME(t1.diagnosistime) AND DATETIME(t1.diagnosistime, '+2 month')