SELECT
  model,
  interp_pnts,
  ld.fcst_init_beg,
  ld.fcst_valid_beg,
  ld.fcst_lead,
  HOUR(fcst_valid_beg) valid_hour,
  obs_thresh,
  interp_mthd,
  vx_mask,
'WRF_precip' 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.obs_thresh IN ('>SOP95')
  AND   BINARY h.interp_mthd IN ('NBRHD_SQUARE')
  AND   BINARY h.vx_mask IN ('AIdom')
  AND   BINARY h.model IN ('AI_run1', 'AI_step06', 'AI_step12')
  AND   BINARY h.interp_pnts IN ('9', '25', '49')
  AND HOUR(ld.fcst_valid_beg) IN ('00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23')
  AND   BINARY h.fcst_var = 'WRF_precip'
  AND ld.stat_header_id = h.stat_header_id
  AND ld.fss != -9999;

