对xml如何检索,可以准确定位到带2个属性的标签行。查了很多地方都没有想要得答案,希望高手指点!!!比如:数据库:id(char(10)), myxml(long)
数据1:id是 1
myxml是 <xml>
<item id="10001" user="people1">1100</item>
<item id="10002" user="people2">1200</item>
<item id="10003" user="people3">1300</item>
</xml>
id是 2
myxml是 <xml>
<item id="10001" user="people2">1200</item>
<item id="10002" user="people1">1100</item>
<item id="10003" user="people3">1300</item>
</xml>我用ctxdll.如何建xml的section可以检索到我想要的第一条数据,方法不是xpath那种,因为属性项希望是可以不具体指定的。
select * from TBL where contains(myxml,'10001 within id and people1 within user' )>0;这样检索出来的是两条数据,而实际我只想要第一条数据。
我表述不是很清楚,但希望高人能帮忙指点~!!!十分感谢!
数据1:id是 1
myxml是 <xml>
<item id="10001" user="people1">1100</item>
<item id="10002" user="people2">1200</item>
<item id="10003" user="people3">1300</item>
</xml>
id是 2
myxml是 <xml>
<item id="10001" user="people2">1200</item>
<item id="10002" user="people1">1100</item>
<item id="10003" user="people3">1300</item>
</xml>我用ctxdll.如何建xml的section可以检索到我想要的第一条数据,方法不是xpath那种,因为属性项希望是可以不具体指定的。
select * from TBL where contains(myxml,'10001 within id and people1 within user' )>0;这样检索出来的是两条数据,而实际我只想要第一条数据。
我表述不是很清楚,但希望高人能帮忙指点~!!!十分感谢!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货