SELECT
  model,
  ld.fcst_init_beg,
  ld.fcst_valid_beg,
  ld.fcst_lead,
  interp_mthd,
  vx_mask,
  fcst_thresh,
  obtype,
'APCP_01' fcst_var,
  'GSS' stat_name,
  'NA' stat_value,
  ld.total,
  ld.fy_oy,
  ld.fy_on,
  ld.fn_oy,
  ld.fn_on,
  ld.ec_value 
FROM
  stat_header h,
  line_data_ctc ld
WHERE
    BINARY h.interp_mthd IN ('NEAREST')
  AND   BINARY h.vx_mask IN ('CONUS')
  AND   BINARY ld.fcst_init_beg IN ('2023-07-02 00:00:00', '2023-07-03 00:00:00', '2023-07-04 00:00:00', '2023-07-05 00:00:00', '2023-07-06 00:00:00', '2023-07-07 00:00:00', '2023-07-08 00:00:00', '2023-07-09 00:00:00', '2023-07-10 00:00:00', '2023-07-11 00:00:00', '2023-07-12 00:00:00', '2023-07-13 00:00:00', '2023-07-14 00:00:00', '2023-07-15 00:00:00', '2023-07-16 00:00:00', '2023-07-17 00:00:00', '2023-07-18 00:00:00', '2023-07-19 00:00:00', '2023-07-20 00:00:00', '2023-07-21 00:00:00', '2023-07-22 00:00:00', '2023-07-23 00:00:00', '2023-07-24 00:00:00', '2023-07-25 00:00:00', '2023-07-26 00:00:00', '2023-07-27 00:00:00', '2023-07-28 00:00:00', '2023-07-29 00:00:00', '2023-07-30 00:00:00', '2023-07-31 00:00:00')
  AND   BINARY h.fcst_thresh IN ('>=0.254')
  AND   BINARY h.obtype IN ('CCPA')
  AND   BINARY h.model IN ('HRRR_verification_mem000', 'RRFS_verification_mem000')
  AND   BINARY ld.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')
  AND   BINARY h.fcst_var = 'APCP_01'
  AND ld.stat_header_id = h.stat_header_id;

