SELECT
  model,
  ld.fcst_init_beg,
  ld.fcst_valid_beg,
  ld.fcst_lead,
  fcst_thresh,
'REFC_ENS_NMEP_ge40_NBRHD25_GAUSSIAN1' fcst_var,
  'PSTD_BRIER' stat_name,
  IF(ld.brier=-9999,'NA',ld.brier ) stat_value,
  IF(ld.brier_ncl=-9999,'NA',ld.brier_ncl  ) stat_ncl,
  IF(ld.brier_ncu=-9999,'NA',ld.brier_ncu  ) stat_ncu,
  'NA' stat_bcl,
  'NA' stat_bcu
FROM
  stat_header h,
  line_data_pstd ld
WHERE
    BINARY h.fcst_thresh IN ('>=2.54')
  AND   BINARY h.model IN ('HREF_prob')
  AND   BINARY ld.fcst_lead IN ('30000', '60000')
  AND   BINARY h.fcst_var = 'REFC_ENS_NMEP_ge40_NBRHD25_GAUSSIAN1'
  AND ld.stat_header_id = h.stat_header_id
  AND ld.brier != -9999;

