SELECT
  model,
  NOW()  fcst_init,
  NOW()  fcst_valid,
  fcst_lead,
  descr,
  fcst_thr,
'WRF_precip' fcst_var,
  'CNTSUM_FSA' stat_name,
  COUNT(*) stat_value
FROM
  mode_header ,
  mode_obj_single ,
  mode_cts 
WHERE
    BINARY descr IN ('NA')
  AND   BINARY fcst_thr IN ('>=0.254')
  AND   BINARY model IN ('AI_step03')
  AND   BINARY fcst_lead IN ('10000', '20000', '30000', '40000', '50000', '70000', '80000', '90000', '100000', '110000', '120000')
 AND  BINARY  fcst_var = 'WRF_precip'
  AND fcst_flag = 1
  AND simple_flag = 1  AND mode_obj_single.mode_header_id = mode_header.mode_header_id
  AND mode_cts.mode_header_id = mode_obj_single.mode_header_id
  AND mode_cts.field = 'OBJECT'
GROUP BY
  fcst_lead,
  model,
  fcst_thr,
  descr

SELECT
  model,
  NOW()  fcst_init,
  NOW()  fcst_valid,
  fcst_lead,
  descr,
  fcst_thr,
'WRF_precip' fcst_var,
  'CNTSUM_OSA' stat_name,
  COUNT(*) stat_value
FROM
  mode_header ,
  mode_obj_single ,
  mode_cts 
WHERE
    BINARY descr IN ('NA')
  AND   BINARY fcst_thr IN ('>=0.254')
  AND   BINARY model IN ('AI_step03')
  AND   BINARY fcst_lead IN ('10000', '20000', '30000', '40000', '50000', '70000', '80000', '90000', '100000', '110000', '120000')
 AND  BINARY  fcst_var = 'WRF_precip'
  AND fcst_flag = 0
  AND simple_flag = 1  AND mode_obj_single.mode_header_id = mode_header.mode_header_id
  AND mode_cts.mode_header_id = mode_obj_single.mode_header_id
  AND mode_cts.field = 'OBJECT'
GROUP BY
  fcst_lead,
  model,
  fcst_thr,
  descr

