create or replace view vw_bm_ybsfdyxmmcfp(
FBBH00, SFXMID, YYXMMC, SFYP00, YBZXLB, YYDJXH, YYDJMC, YBXMBH, YBXMMC, 
YBZYFP, ZYFPXM, YBMZFP, MZFPXM, ZFBL00, ZFJE00, SFYBXM, YBLB00, YYXMBH, 
YBBRLB, JMBL00, JMJE00, SFSX00, BH0000, BZ0000, TZBZ00, PYSM00, WBSM00, 
DYBZ00, SCCJ00, YBSCCJ, FYID00, YBBZ00
)as
select  A.FBBH00,A.SFXMID,B.XMMC00,A.SFYP00,A.YBZXLB,F.YYDJXH,F.YYDJ00,A.YBXMBH,C.XMMC00,A.YBZYFP,D.XMMC00,
A.YBMZFP,E.XMMC00,A.ZFBL00,A.ZFJE00,A.SFYBXM,A.YBLB00,B.BH0000,A.YBBRLB,A.JMBL00,A.JMJE00,A.SFSX00,B.BH0000,
trim(substrb(B.BZ0000,1,100)),decode(B.TZRQ00,null,'0','1'),B.PYSM00,B.WBSM00,A.BZ0000,B.SCCJ00,C.SCCJ00,
--B.FYID00,
nvl(B.FYID00,'0'||'     '),
A.BZ0000
FROM  BM_YBSFDY A,BM_YYSFXM B,BM_YBSFXM C,BM_YBFPXM D,BM_YBFPXM E,BM_YYDJ00 F
WHERE A.SFYP00='N' AND A.SFXMID=B.SFXMID AND A.FBBH00<>0 AND A.FBBH00=C.FBBH00(+) and
      A.YBZXLB=C.YBZXLB(+) AND A.YBXMBH=C.XMBH00(+) AND A.FBBH00=D.FBBH00(+) AND
      A.YBZYFP=D.BH0000(+) AND A.YBMZFP=E.BH0000(+) AND A.FBBH00=E.FBBH00(+) AND
      A.YBZXLB=D.YBZXLB(+) AND A.YBZXLB=E.YBZXLB(+) AND A.YYDJ00=F.YYDJXH(+)