select max(a.viseq) as viseq,count(distinct a.viseq) as cnt
from axm99 h,aur32 a
where a.ktktcd=:ktktcd
	and a.mcd=:mcd
	and a.vseq=:vseq
	and a.dcls='4'
	and a.sts=0
	and a.ktktcd=h.ktktcd
	and a.sbat2>=h.ssbat2
