SELECT
  model,
  ld.fcst_init_beg,
  ld.fcst_valid_beg,
  ld.fcst_lead,
'MOSA' fcst_var,
  'ANOM_CORR_UNCNTR' stat_name,
  IF(ld.anom_corr_uncntr=-9999,'NA',ld.anom_corr_uncntr ) stat_value,
  'NA' stat_ncl,
  'NA' stat_ncu,
  IF(ld.anom_corr_uncntr_bcl=-9999,'NA',ld.anom_corr_uncntr_bcl) stat_bcl,
  IF(ld.anom_corr_uncntr_bcu=-9999,'NA',ld.anom_corr_uncntr_bcu ) stat_bcu
FROM
  stat_header h,
  line_data_cnt ld
WHERE
    BINARY h.model IN ('CTRECv1.4_RWRFgrid', 'CTRECv1.4_RWRFgrid_lo', 'CTRECv1.6_RWRFgrid', 'CTRECv1.6_RWRFgrid_lo', 'RWRF', 'RWRF_cal', 'RWRF_ladj', 'RWRF_lo')
  AND   BINARY ld.fcst_lead IN ('0', '3000', '10000', '13000', '20000', '23000', '30000', '33000', '40000', '43000', '50000', '60000', '70000', '80000', '90000', '100000', '110000', '120000')
  AND   BINARY h.fcst_var = 'MOSA'
  AND ld.stat_header_id = h.stat_header_id
  AND ld.anom_corr_uncntr != -9999;

