下面的查询表达式:
SELECT distinct xmlCol.value('(//interest/@id)[1]','nvarchar(64)') FROM table1
返回一个列表id of first interest所有记录的元素。
但 xml 可能包含multiple interest元素。
那么,如何获得所有的不同列表interestsql xquery 中所有记录的元素?
select distinct T.N.value('.','nvarchar(64)')
from table1
cross apply xmlCol.nodes('//interest/@id') as T(N)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)