SELECT
  model,
  ld.fcst_init_beg,
  ld.fcst_valid_beg,
  ld.fcst_lead,
'AOTK' fcst_var,
  'BCMSE' stat_name,
  IF(ld.bcmse=-9999,'NA',ld.bcmse ) stat_value,
  'NA' stat_ncl,
  'NA' stat_ncu,
  IF(ld.bcmse_bcl=-9999,'NA',ld.bcmse_bcl) stat_bcl,
  IF(ld.bcmse_bcu=-9999,'NA',ld.bcmse_bcu ) stat_bcu
FROM
  stat_header h,
  line_data_cnt ld
WHERE
    BINARY h.model IN ('RRFS_verification_mem000')
  AND   BINARY ld.fcst_lead IN ('0', '30000', '50000', '60000', '70000', '180000', '210000', '240000', '250000', '300000', '310000', '330000', '370000', '400000', '410000', '430000', '480000', '540000', '560000', '590000', '710000', '740000', '800000')
  AND   BINARY h.fcst_var = 'AOTK'
  AND ld.stat_header_id = h.stat_header_id
  AND ld.bcmse != -9999;

