Foxtable(狐表)用户栏目专家坐堂 → BOM数据展开,制造业的高手请进!


  共有24279人关注过本帖平板打印复制链接

主题:BOM数据展开,制造业的高手请进!

帅哥哟,离线,有人找我吗?
lxl
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 一级勋章
等级:MVP荣誉狐 帖子:858 积分:6071 威望:0 精华:19 注册:2008/9/1 9:13:00
  发帖心情 Post By:2010/4/16 15:49:00 [只看该作者]

单级正展:select * from BOM表 where parentitem = 'B-WG-XJ-QG-12'

多级正展:
;with cte As
(
select * from BOM表 where parentitem = 'CP-WG-JSG-0210'
union all
select a.* from BOM表 a
join cte on a.parentitem  = cte.childitem
)
select  * from cte

至于原材料正展,不知道childtype 有没有表示出原材料。假设 childtype 等于 00为原材料的话:
;with cte As
(
select * from BOM表 where parentitem = 'CP-WG-JSG-0210'
union all
select a.* from BOM表 a
join cte on a.parentitem  = cte.childitem
)
select  * from cte
where childtype = '00'

 

可以用fill 方法把数据直接填充到 表里面去
tables("窗口1_table1").Fill("SQL语句","外部数据源",true)











[本帖被加为精华]
 回到顶部
总数 40 1 2 3 4 下一页