SELECT a.nm as rcvdstnm,
'0' as stpflg
FROM (select rcvdst,cucd,ktktcd from afm03c group by rcvdst,cucd,ktktcd) c,afm90 a
WHERE A.SCLS1=C.RCVDST
  AND C.KTKTCD=:ktktcd
  AND A.CLS='N'
  and a.scls1=:rcvdst
