select a.mnm,a.mnms,a.mknm,a.mknms,a.kmcd,d.mnm kmnm,a.mchgcd,b.chgnm mchgcdnm,a.echgcd,c.chgnm echgcdnm,a.mzip,a.madd1,a.madd2,
	a.mkad1,a.mkad2,a.mtel,a.mfax,a.mmail,a.mpnm,a.mchgnm,a.mcom,
	a.modfr,a.htel,a.hfax,a.htcls,a.htpnt1,a.htpnt2,a.htlmt1,a.htlmt2,a.paycls,a.mpcls,a.paydat,a.pmn,a.rper,
	a.cdcls,a.mres,a.mpay,a.msu,
	a.mtori,a.meda,a.plcd,a.plhcls,
	to_char(a.reg,'yy/mm/dd hh24:mi') reg,
	to_char(a.upd,'yy/mm/dd hh24:mi') upd,
	to_char(a.stp,'yy/mm/dd hh24:mi') stp
from afm04 d,afm08 c,afm08 b,afm04 a
where a.mcd=:mcd
  and a.mchgcd=b.chgcd(+)
  and a.echgcd=c.chgcd(+)
  and a.kmcd=d.mcd(+)