`
菜菜菜
  • 浏览: 24573 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

学习随笔--数据库联合查询--xml查询

阅读更多
select a.orderid,     
xmltype.extract(value(b),'/orderDetail/@cere__mode').getstringval() model,     
xmltype.extract(value(b),'/orderDetail/@number').getstringval() num,     
c.type_code,     
c.type_content     
from      
produce_order a,     
table(xmlsequence(xmltype.extract(a.xml_content,'/prodOrder/list[@id="detail"]/orderDetail'))) b,     
v_raw_material c     
where      
xmltype.extract(value(b),'/orderDetail/@produceId').getstringval()=c.code    
union    
select         
a.orderid,     
xmltype.extract(a.xml_content,'/planOrder/@ggmodel').getstringval() model,     
xmltype.extract(a.xml_content,'/planOrder/@num').getstringval() num,     
b.type_code,     
b.type_content     
from produce_plan_order a,v_raw_material b     
where     
xmltype.extract(a.xml_content,'/planOrder/@cpid').getstringval()=b.code    
union     
select         
a.orderid,     
xmltype.extract(value(b),'/orderDetail/@cereMode').getstringval() model,     
xmltype.extract(value(b),'/orderDetail/@number').getstringval() num,    
c.type_code,     
c.type_content     
from c_bg_maintain_outstore_order a,    
table(xmlsequence(xmltype.extract(a.xml_content,'/clientBackMaintainOutStoreOrder/list[@id="detail"]/orderDetail'))) b,     
v_raw_material c    
where      
xmltype.extract(value(b),'/orderDetail/@produceId').getstringval()=c.code         
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics