一句SQL找出組件相同的bom

       

 看下圖bom結構,需求: 找出 A1 這份bom ,這個需求在工廠企業中很常見

select * from t29; 

最終實現效果

       

實現過程如下:

1.demo表結構創建

create table t29 as

with a as

(select 'A' bmb01, 'B1' bmb03

from dual

union all

select 'A' bmb01, 'B2' bmb03

from dual

union all

select 'A1' bmb01, 'B1' bmb03

from dual

union all

select 'A1' bmb01, 'B2' bmb03

from dual

union all

select 'A2' bmb01, 'B1' bmb03

from dual

union all

select 'A2' bmb01, 'C' bmb03 from dual)

select * from a

       

詳細實現過程如下:

https://articles.zsxq.com/id_2xm2mbbzjrjr.html

   

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章