CROSS APPLY to namespace, sub nodes returns duplicate records(CROSS APPLY 到命名空间,子节点返回重复记录)
问题描述
我有这个 xml(为了可读性删除了大部分).我得到错误的记录.为每个 CAS_Number
提取的化学名称错误.一个 CAS_Number
表示一种化学品.但在这里,对于相同的 CAS_number
,我有不同的化学名称.
I have this xml (removed most of it for readability). I get wrong records. Wrong chemical names fetched for every CAS_Number
. One CAS_Number
means one chemical. But here, for the same CAS_number
, I have different chemical names.
这是我交叉申请中的问题,但我无法弄清楚.
It's the problem in my cross apply but I couldn't figure it out.
存储过程是这样的:
推荐答案
试试这个:
我获得了每个
节点的 XML 片段列表,并从中获取了 ProductIdentifiers
信息.另外,从这个节点,我还获得了
节点的子 XML 片段列表,并从中获取详细信息.
I get a list of XML fragments for each <Msds>
node, and from this I grab the ProductIdentifiers
info. Plus, from this node, I also get a list of sub-XML-fragments for the <Ingredients>
nodes, and grab detailed into from these.
我的输出如下所示:
这篇关于CROSS APPLY 到命名空间,子节点返回重复记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!