表里面点开一个XML字段的值如下

<MasterxRow>
<ActivityType>2</ActivityType>
<ProductType>21</ProductType>
<RefNo>222222222222222222222</RefNo>
<ContactResult>0</ContactResult>
<Reason />
<OtherReason />
<OtherActivityType />
<OtherProductType />
<ReferrerID />
<ReferrerType />
<CampaignCode>889</CampaignCode>
<CampaignName>70</CampaignName>
<IsNull>false</IsNull>
<AcceptReason>合作愉快</AcceptReason>
<AcceptReasonText>99</AcceptReasonText>
</MasterxRow>

搜索所有符合ProductType=21的数据

select * from tblContactLogs
where ProductResponse.exist('//ProductType[.=3]')=1

获取节点里面的值

SELECT ProductResponse.value ('(//ProductType)[1]' , 'varchar(max)' ) as ProductType From table

相关文章:

  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-16
  • 2021-12-25
猜你喜欢
  • 2022-02-18
  • 2022-12-23
  • 2021-05-27
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案