戈登,我对您的帮助深表谢意。您帮助了我一些基本的缺陷,并且完成了一些调整,并且在大多数情况下满足了我的需求……至少到目前为止。这已经让我发疯了很长一段时间。我确定的代码在下面,以防将来对其他人有所帮助
With BMStudy as ( select bm.ppn_i, bm.cpn_i, bm.bomname_i, bm.QUANTITY_I, 1 as BOMLevel from BM010115 bm where bm.PPN_I like '0123105-HWT' and bm.BOMNAME_I like '' UNIOn ALL select ba.ppn_i, bb.cpn_i, bb.bomname_i, bb.quantity_i, (BOMLevel + 1) as BOMLevel from BMStudy ba join BM010115 bb on ba.cpn_i = bb.ppn_i where bb.BOMNAME_I like '' ) select top 1000 BMStudy.*, i.ITEMDESC from BMStudy, iv00101 i where CPN_I = itemnmbr order by BOMLEVEL, CPN_I ASC OPTION (MAXRECURSION 0)
再次感谢!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)