SELECT
  model,
  ld.fcst_init_beg,
  ld.fcst_valid_beg,
  ld.fcst_lead,
  fcst_thresh,
'WRF_precip' fcst_var,
  'FBIAS' stat_name,
  IF(ld.fbias=-9999,'NA',ld.fbias ) stat_value,
  'NA' stat_ncl,
  'NA' stat_ncu,
  IF(ld.fbias_bcl=-9999,'NA',ld.fbias_bcl) stat_bcl,
  IF(ld.fbias_bcu=-9999,'NA',ld.fbias_bcu ) stat_bcu
FROM
  stat_header h,
  line_data_cts ld
WHERE
    BINARY h.model IN ('AI_step06', 'AI_step12')
  AND   BINARY h.fcst_thresh IN ('>0', '>=0.254', '>=2.54', '>=6.35', '>=12.7')
  AND   BINARY h.fcst_var = 'WRF_precip'
  AND ld.stat_header_id = h.stat_header_id
  AND ld.fbias != -9999;

