SELECT
  model,
  ld.fcst_init_beg,
  ld.fcst_valid_beg,
  ld.fcst_lead,
'DPT' fcst_var,
  'MSE' stat_name,
  IF(ld.mse=-9999,'NA',ld.mse ) stat_value,
  'NA' stat_ncl,
  'NA' stat_ncu,
  IF(ld.mse_bcl=-9999,'NA',ld.mse_bcl) stat_bcl,
  IF(ld.mse_bcu=-9999,'NA',ld.mse_bcu ) stat_bcu
FROM
  stat_header h,
  line_data_cnt ld
WHERE
    BINARY h.model IN ('NSSL_MPAS_RT_mem000')
  AND   BINARY ld.fcst_lead IN ('0', '10000', '20000', '30000', '40000', '50000', '60000', '70000', '80000', '90000', '100000', '110000', '120000', '130000', '140000', '150000', '160000', '170000', '180000', '190000', '200000', '210000', '220000', '230000', '240000', '250000', '260000', '270000', '280000', '290000', '300000', '310000', '320000', '330000', '340000', '350000', '360000', '370000', '380000', '390000', '400000', '410000', '420000', '430000', '440000', '450000', '460000', '470000', '480000')
  AND   BINARY h.fcst_var = 'DPT'
  AND ld.stat_header_id = h.stat_header_id
  AND ld.mse != -9999;

