当前位置: 代码迷 >> Sql Server >> 跪求好手帮忙用SQL语句展BOM
  详细解决方案

跪求好手帮忙用SQL语句展BOM

热度:39   发布时间:2016-04-24 09:59:21.0
跪求高手帮忙用SQL语句展BOM
1、表结构如下
PartNum                           Mtlseq            MtlPartNum                                     Quantity           Rev
17138090001004           10                  21138090201002                              1                      A
17138090001004           20                  63302490175056                               0.1                  A
21138090201002           10                  62210560460008                               0.2                    A
21138090201002            20                 5011414                                               0.3                  A
62210560460008            10                 5011414                                               0.2                    A
5011414                            10                  51200                                                   1                      A

2、目前我写的存储过程只能展成如下样式
PartNum                       Mtlseq    PMtlSeq  ArtIndex    Level           MtlPartNum             Rev    Quantity       Levels
17138090001004          10         10                10          *1             21138090201002     A           1                   1
17138090001004          20         20                20          *1             63302490175056     A            0.1               1
21138090201002          10         10.10         10.10       *2            62210560460008     A            0.2               2
  相关解决方案