select a.ijan,nvl(c.gdstun,a.gdstun) gdstun,a.gdcls9,b.scls5 gdcls9nm,
       a.gdjnm,a.gdcnum,a.gdbnum,a.gdcls7,a.gdstp
from afm03 m03, afm0311 c,afm90 b, afm02 a
where b.cls(+)='6' and a.gdcls9=b.scls1(+)
     and a.ijan=c.ijan(+) and c.cucd(+)=:cucd
     and a.ijan=:ijan
     and m03.cucd=:cucd
     