物料清单BOM简单递归查询
--BOM物料清单递归查询 WITH t AS( SELECT a.FID, a.FMATERIALID PFMATERIALID, b.FMATERIALID CFMATERIALID, b.FNUMERATOR CFNUMERATOR, b.FDENOMINATOR CFDENOMINATOR, am.FNUMBER PFMATERIALNO, bm.FNUMBER CFMATERIALNO, aml.FNAME PFMATERIALNAME, bml.FNAME CFMATERIALNAME, bml.FSPECIFICATION, u.FNAME CFUNITNAME FROM T_ENG_BOM a INNER JOIN T_ENG_BOMCHILD b ON a.FID = b.FID INNER JOIN T_BD_MATERIAL am ON a.FMATERIALID = am.FMATERIALID INNER JOIN T_BD_MATERIAL_L aml on am.FMATERIALID = aml.FMATERIALID INNER JOIN T_BD_MATERIAL bm ON b.FMATERIALID = bm.FMATERIALID INNER JOIN T_BD_MATERIAL_L bml on b.FMATERIALID = bml.FMATERIALID INNER JOIN T_BD_UNIT_L u on b.FUNITID = u.FUNITID ),t2 AS ( SELECT * FROM t WHERE t.PFMATERIALNO like '%13' UNION ALL SELECT t.* FROM t2 INNER JOIN t on t.PFMATERIALID = t2.CFMATERIALID ) SELECT * FROM t2 OPTION (MAXRECURSION 5)
物料清单BOM简单递归查询
--BOM物料清单递归查询WITH t AS( SELECT a.FID, a.FMATERIALID PFMATERIALID, b.FMATERIALID CFMATERIALID, b.FNUMERATOR CFNUMERATOR...
点击下载文档
本文2024-09-16 18:31:20发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-22679.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章