Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
クエリ式の下:
SELECT distinct xmlCol.value('(//interest/@id)[1]','nvarchar(64)') FROM table1
すべてのレコードの最初の対象要素のIDのリストを返します。
ただし、xml には複数の interest要素が含まれる場合があります。
では、 sql xquery のすべてのレコードのすべての対象要素の個別のリストを取得するにはどうすればよいでしょうか?
select distinct T.N.value('.','nvarchar(64)') from table1 cross apply xmlCol.nodes('//interest/@id') as T(N)