MS SQL 用WIHT CTE展开BOM的阶层,并展出他所在的层次码,母层必须紧跟下...答:declare @table table (sortseq int,bompart nvarchar(100),compart nvarchar(100))insert into @table --最顶层资料select'10','A1','B1'union allselect '20','A1','B2'insert into @table --第二层资料select '10','B1','C1'union allselect '20','B2','C2' insert into @...