select 
	a.jan,a.ijan,b.scls5,a.gdjnm,a.gdjstnd,
	a.mcd,c.mnm,a.gdhtun,a.gdstun,
	a.gdcnum,a.gdcwid,a.gdcdep,a.gdchig,a.gdcwgh,
	a.gdbnum,a.gdbwid,a.gdbdep,a.gdbhig,a.gdbwgh,
	a.gdpwid,a.gdpdep,a.gdphig,a.gdpwgh
from afm04 c,afm90 b,afm02 a
where a.ijan=:ijan
	and b.cls(+)='6' and a.gdcls9=b.scls1(+)
	and a.mcd = c.mcd(+)
	and rownum=1