select
  a.cucd,
  a.cuscd, a.spnm,
  a.cshcd, b.cshnm,
  decode(w81.wseq,null,null,'checked') chkflg
from afw81 w81, afm036 b, afm032 a
where a.cucd=b.cucd(+) and a.cshcd=b.cshcd(+)
  and a.cucd=w81.cucd(+) and a.cuscd=w81.cuscd(+) and w81.wseq(+)=:wseq
  and a.cucd=:cucd
  and a.cuscd<>:cuscd
  and a.spstp is null
order by a.cucd,a.cuscd