SELECT
  model,
  fcst_init,
  NOW()  fcst_valid,
  
'APCP_01_ENS_NEP_ge2.54_NBRHD729' fcst_var,
  'CNTSUM_AAA' stat_name,
  COUNT(*) stat_value
FROM
  mode_header ,
  mode_obj_single ,
  mode_cts 
WHERE
    BINARY model IN ('nostoch', 'stoch')
  AND   BINARY fcst_init IN ('2022-04-30 00:00:00', '2022-05-01 00:00:00', '2022-05-02 00:00:00', '2022-05-03 00:00:00', '2022-05-04 00:00:00', '2022-05-05 00:00:00', '2022-05-06 00:00:00', '2022-05-07 00:00:00', '2022-05-08 00:00:00', '2022-05-09 00:00:00', '2022-05-10 00:00:00', '2022-05-11 00:00:00', '2022-05-12 00:00:00')
 AND  BINARY  fcst_var = 'APCP_01_ENS_NEP_ge2.54_NBRHD729'  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_init,
  model

