mysql查询bom清单按BOM清单展开物料及需求(SQL).pdfVIP

  • 12
  • 0
  • 约1.97千字
  • 约 2页
  • 2024-04-14 发布于湖北
  • 举报

mysql查询bom清单按BOM清单展开物料及需求(SQL).pdf

mysql查询bom清单_按BOM清单展开物料及需求(SQL)

适环境:

的去展开BOM

CREATEfunctionf_pcode1(@codevarchar(20))

returns@re1table(codevarchar(20),fathervarchar(20),uomvarchar(5),quantityfloat,level1int)

as

begin

declare@lint

declare@fathervarchar(20)

declare@uomvarchar(5)

declare@quantityfloat

set@l=0

insert@re1select@code,@father,@uom,@quantity,@l

while@@rowcount0

begin

set@l=@l+1

insert@re1(code,father,uom,quantity,level1)selecta.code,a.father,a.uom,a.quantity,@l

fromitt1a,@re1b

wherea.father=b.codecollatedatabase_default

andb.level1=@l-1

end

return

end

文档评论(0)

1亿VIP精品文档

相关文档