SELECT
  model,
  ld.fcst_init_beg,
  ld.fcst_valid_beg,
  ld.fcst_lead,
  HOUR(fcst_valid_beg) valid_hour,
  HOUR(fcst_init_beg) init_hour,
'ProxyCompReflCalibratedMosaic' fcst_var,
  'BASER' stat_name,
  IF(ld.baser=-9999,'NA',ld.baser ) stat_value,
  IF(ld.baser_ncl=-9999,'NA',ld.baser_ncl  ) stat_ncl,
  IF(ld.baser_ncu=-9999,'NA',ld.baser_ncu  ) stat_ncu,
  IF(ld.baser_bcl=-9999,'NA',ld.baser_bcl) stat_bcl,
  IF(ld.baser_bcu=-9999,'NA',ld.baser_bcu ) stat_bcu
FROM
  stat_header h,
  line_data_cts ld
WHERE
  HOUR(ld.fcst_init_beg) IN ('00')
  AND   BINARY h.model IN ('GSWR')
  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 = 'ProxyCompReflCalibratedMosaic'
  AND ld.stat_header_id = h.stat_header_id
  AND ld.baser != -9999;

