SELECT
  model,
  ld.fcst_init_beg,
  ld.fcst_valid_beg,
  ld.fcst_lead,
'NmF2' fcst_var,
  'MBIAS' stat_name,
  IF(ld.mbias=-9999,'NA',ld.mbias ) stat_value,
  'NA' stat_ncl,
  'NA' stat_ncu,
  IF(ld.mbias_bcl=-9999,'NA',ld.mbias_bcl) stat_bcl,
  IF(ld.mbias_bcu=-9999,'NA',ld.mbias_bcu ) stat_bcu
FROM
  stat_header h,
  line_data_cnt ld
WHERE
    BINARY h.model IN ('WAMIPE')
  AND   BINARY ld.fcst_lead IN ('0')
  AND   BINARY h.fcst_var = 'NmF2'
  AND ld.stat_header_id = h.stat_header_id
  AND ld.mbias != -9999;

