SELECT
  model,
  ld.fcst_init_beg,
  ld.fcst_valid_beg,
  ld.fcst_lead,
  obtype,
'APCP' 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.obtype IN ('CCPA', 'IMERG')
  AND   BINARY h.model IN ('hfsa_shift', 'hfsb_shift')
  AND   BINARY ld.fcst_lead IN ('60000', '120000', '180000', '240000', '300000', '360000', '420000', '480000', '540000', '600000', '660000', '720000', '780000', '840000', '900000', '960000', '1020000', '1080000', '1140000', '1200000', '1260000')
  AND   BINARY h.fcst_var = 'APCP'
  AND ld.stat_header_id = h.stat_header_id
  AND ld.fbias != -9999;

