SELECT
  model,
  ld.fcst_init_beg,
  ld.fcst_valid_beg,
  ld.fcst_lead,
  fcst_thresh,
'MOSA' fcst_var,
  'FAR' stat_name,
  'NA' stat_value,
  ld.total,
  ld.fy_oy,
  ld.fy_on,
  ld.fn_oy,
  ld.fn_on,
  ld.ec_value 
FROM
  stat_header h,
  line_data_ctc ld
WHERE
    BINARY h.fcst_thresh IN ('>=20')
  AND   BINARY h.fcst_var IN ('MOSA')
  AND   BINARY h.model IN ('CTRECv1.6_RWRFgrid', 'RWRF')
  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
UNION ALL
SELECT
  model,
  ld.fcst_init_beg,
  ld.fcst_valid_beg,
  ld.fcst_lead,
  fcst_thresh,
'MOSA' fcst_var,
  'PODY' stat_name,
  'NA' stat_value,
  ld.total,
  ld.fy_oy,
  ld.fy_on,
  ld.fn_oy,
  ld.fn_on,
  ld.ec_value 
FROM
  stat_header h,
  line_data_ctc ld
WHERE
    BINARY h.fcst_thresh IN ('>=20')
  AND   BINARY h.fcst_var IN ('MOSA')
  AND   BINARY h.model IN ('CTRECv1.6_RWRFgrid', 'RWRF')
  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;

