select sum(LH) LH,sum(SG) SG,sum(SE) SE,sum(SV) SV, sum(prim) prim from (
select
sum(if(ifnull(sec_cor_lh,"")="LH",1,0)) LH,
sum(if(ifnull(sec_cor_SG,"")="SG",1,0)) SG,
sum(if(ifnull(sec_cor_SE,"")="SE",1,0)) SE,
sum(if(ifnull(sec_cor_SV,"")="SV",1,0)) SV,
0 prim

 from proctor_details
where
  ifnull(detailapproved,0)=1 and
 DETAIL_tYPE= 'PROCTOR' and ifnull(sec_subject_id,0) <>0
and insertdate<'2018-1-1'
union

select
0 LH,
0 SG,
0 SE,
0 SV,count(proctorid) prim

 from proctor_details
where
  ifnull(detailapproved,0)=1 and
 DETAIL_tYPE= 'PROCTOR' and ifnull(prim_subject_id,0) <>0
and insertdate<'2018-1-1'
) a
 ;
