       WHEN c.itemid IN (920, 1394, 4187, 3486, 226707)
         THEN c.valuenum * 2.54
       ELSE c.valuenum
-    END AS valuenum as height
+    END AS height
   FROM chartevents c
   WHERE c.valuenum IS NOT NULL
   AND c.valuenum != 0

(
  SELECT
    icustay_id,
    FIRST_VALUE(valuenum) over W AS height_first,
    MIN(valuenum) over W AS height_min,
    MAX(valuenum) over W AS height_max
    FROM ht_fix
    WINDOW W AS
    (

  ie.icustay_id,
  ROUND(CAST(wt.weight_first AS NUMERIC), 2) AS weight_first,
  ROUND(CAST(wt.weight_min AS NUMERIC), 2) AS weight_min,
  ROUND(CAST(wt.weight_max AS NUMERIC), 2) AS weight_max,
  ROUND(CAST(ht.height_first AS NUMERIC), 2) AS height_first,
  ROUND(CAST(ht.height_min AS NUMERIC), 2) AS height_min,
  ROUND(CAST(ht.height_max AS NUMERIC), 2) AS height_max
FROM icustays ie
LEFT JOIN wt
  ON ie.icustay_id = wt.icustay_id
