select
	a.viseq,
	to_char(a.adat, 'yyyy/mm/dd') as adat,
	a.iseq30,
	a.vlin,
	c.jan,
	a.ijan,
	c.gdjnm,
	c.gdjstnd,
	a.jpno,
	a.ncst,
	a.tpno,
	a.fcst,
	c.gdcls9,
	d.scls5 gdcls9nm,
	a.txt2,
	a.spktcd,
	a.tcls,
	e.chgnm chgcdnm,
	to_char(a.idat, 'yyyy/mm/dd hh24:mi:ss') as idat,
	f.chgnm upchgnm,
	case when a.udat=a.idat then null else to_char(a.udat, 'yyyy/mm/dd hh24:mi:ss') end udat
from axm99 h,afm08 f,afm08 e,afm90 d,afm02 c,aur32 a
where a.ktktcd=:ktktcd
	and a.mcd=:mcd
	and a.vseq=:vseq
	and a.dcls='3' and a.tcls='13'
	and a.sts=0
	and a.viseq=:viseq
	and a.ktktcd=h.ktktcd
	and a.sbat2>=h.ssbat2
	and a.ijan=c.ijan(+)
	and d.cls(+)='6' and c.gdcls9=d.scls1(+)
	and a.chgcd=e.chgcd(+)
	and a.upchg=f.chgcd(+)
order by a.vlin
