云星空创建组织下BOM和使用组织下BOM不一致查询sql原创
金蝶云社区-ALAOK
ALAOK
7人赞赏了该文章 756次浏览 未经作者许可,禁止转载编辑于2022年04月21日 10:15:44

SELECT C.AFNUMBER,C.BFNUMBER,F.EFNUMBER FROM(SELECT  A.FID,A.FNUMBER AFNUMBER,B.FNUMBER BFNUMBER FROM T_ENG_BOM A INNER JOIN T_BD_MATERIAL B ON(A.FMATERIALID=B.FMATERIALID AND A.FFORBIDSTATUS='A' AND A.FUSEORGID=使用组织ID)) C INNER JOIN (SELECT  D.FID,E.FNUMBER EFNUMBER FROM T_ENG_BOMCHILD D INNER JOIN T_BD_MATERIAL E ON(D.FMATERIALID=E.FMATERIALID))F ON(C.FID=F.FID)

EXCEPT

SELECT C.AFNUMBER,C.BFNUMBER,F.EFNUMBER FROM(SELECT  A.FID,A.FNUMBER AFNUMBER,B.FNUMBER BFNUMBER FROM T_ENG_BOM A INNER JOIN T_BD_MATERIAL B ON(A.FMATERIALID=B.FMATERIALID AND A.FUSEORGID=创建组织ID)) C 

INNER JOIN (SELECT  D.FID,E.FNUMBER EFNUMBER FROM T_ENG_BOMCHILD D INNER JOIN T_BD_MATERIAL E ON(D.FMATERIALID=E.FMATERIALID))F ON(C.FID=F.FID)ORDER BY AFNUMBER


图标赞 7
7人点赞
还没有人点赞,快来当第一个点赞的人吧!
图标打赏
0人打赏
还没有人打赏,快来当第一个打赏的人吧!