xquery XML迭代读取值
不好意思,不知道这个问题发帖在这里是否合适。
Declare @x xml
set @x='
<smss date="676876876876">
<address data="+6547689879088">
<sms date="5435435435435" read="1" status="-1" type="1" body="fdsfdsfsdfsf"/>
<sms date="65876876876876" read="1" status="-1" type="2" body="54654tgfffhfhfg"/>
</address>
<address data="+534654765876876">
<sms date="879868698" read="1" status="-1" type="1" body="8678768979878798gfdg"/>
<sms date="54765787687" read="1" status="-1" type="1" body="76876978098p009o"/>
<sms date="6y5765875" read="1" status="-1" type="1" body="76576587698798"/>
</address>
<address data="+76587687980">
<sms date="676787687" read="1" status="-1" type="1" body="hgfdhdghgdhg"/>
<sms date="5try" read="1" status="-1" type="1" body="gfdhggdhgd"/>
<sms date="y65y65" read="1" status="-1" type="1" body="reetrytr"/>
<sms date="y65y65" read="1" status="-1" type="1" body="ytrytrytrytr"/>
<sms date="y65y65" read="1" status="-1" type="1" body="ytrytrytry"/>
<sms date="y65y65" read="1" status="-1" type="1" body="uyiyjuyiu"/>
<sms date="y65y65" read="1" status="-1" type="1" body="oyoiukiu"/>
<sms date="y65y65" read="1" status="-1" type="1" body="ikyiy"/>
<sms date="y65y65" read="1" status="-1" type="1" body="kyiuykuykuy"/>
<sms date="y65y65" read="1" status="-1" type="1" body="kiykikuui"/>
</address>
</smss>’
我想通过xquery 迭代 语句for 取出 “/smss/address/sms/@body”中所有@body的值,不知道select 语句怎么写。