SELECT
  model,
  ld.fcst_init_beg,
  ld.fcst_valid_beg,
  ld.fcst_lead,
'APCP_03' fcst_var,
  'NBR_FSS' stat_name,
  IF(ld.fss=-9999,'NA',ld.fss ) stat_value,
  'NA' stat_ncl,
  'NA' stat_ncu,
  IF(ld.fss_bcl=-9999,'NA',ld.fss_bcl) stat_bcl,
  IF(ld.fss_bcu=-9999,'NA',ld.fss_bcu ) stat_bcu
FROM
  stat_header h,
  line_data_nbrcnt ld
WHERE
    BINARY h.model IN ('HREF')
  AND   BINARY ld.fcst_lead IN ('30000', '60000')
  AND   BINARY h.fcst_var = 'APCP_03'
  AND ld.stat_header_id = h.stat_header_id
  AND ld.fss != -9999;

