น้ำหนักของผู้ป่วยปี 2559 ครั้งแรกจนถึง 6 เดือนที่แล้วเป็นเท่าใด?ไม่จำเป็นต้องใช้ตารางทั้งหมด
what was patient 20165's weight the first time until 6 months ago?It is not neccessary to use all the tables.
 chartevents:  row_id [ number]  subject_id [ number]  hadm_id [ number]  icustay_id [ number]  itemid [ number]  charttime [ time]  valuenum [ number]  valueuom [ text] 
SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20165)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' AND d_items.linksto = 'chartevents') AND DATETIME(chartevents.charttime) <= DATETIME(CURRENT_TIME(), '-6 month') ORDER BY chartevents.charttime LIMIT 1