SELECT
  model,
  NOW()  fcst_init,
  NOW()  fcst_valid,
  fcst_lead,
'APCP_01_ENS_NEP_ge2.54_NBRHD729' fcst_var,
  'CNTSUM_FAA' stat_name,
  COUNT(*) stat_value
FROM
  mode_header ,
  mode_obj_single ,
  mode_cts 
WHERE
    BINARY model IN ('nostoch', 'stoch')
  AND   BINARY fcst_lead IN ('10000', '20000', '30000', '40000', '50000', '60000', '70000', '80000', '90000', '100000', '110000', '120000', '130000', '140000', '150000', '160000', '170000', '180000', '190000', '200000', '210000', '220000', '230000', '240000', '250000', '260000', '270000', '280000', '290000', '300000', '310000', '320000', '330000', '340000', '350000', '360000')
 AND  BINARY  fcst_var = 'APCP_01_ENS_NEP_ge2.54_NBRHD729'
  AND fcst_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

SELECT
  model,
  NOW()  fcst_init,
  NOW()  fcst_valid,
  fcst_lead,
'APCP_01_ENS_NEP_ge2.54_NBRHD729' fcst_var,
  'CNTSUM_OSA' stat_name,
  COUNT(*) stat_value
FROM
  mode_header ,
  mode_obj_single ,
  mode_cts 
WHERE
    BINARY model IN ('nostoch', 'stoch')
  AND   BINARY fcst_lead IN ('10000', '20000', '30000', '40000', '50000', '60000', '70000', '80000', '90000', '100000', '110000', '120000', '130000', '140000', '150000', '160000', '170000', '180000', '190000', '200000', '210000', '220000', '230000', '240000', '250000', '260000', '270000', '280000', '290000', '300000', '310000', '320000', '330000', '340000', '350000', '360000')
 AND  BINARY  fcst_var = 'APCP_01_ENS_NEP_ge2.54_NBRHD729'
  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

