Select distinct list of all elements x of all records in sql xquery

前端 未结 1 728
醉话见心
醉话见心 2021-01-13 14:04

Below query expression:

SELECT distinct xmlCol.value(\'(//interest/@id)[1]\',\'nvarchar(64)\') FROM table1

Returns a list of id of

相关标签:
1条回答
  • 2021-01-13 14:47
    select distinct T.N.value('.','nvarchar(64)')
    from table1
      cross apply xmlCol.nodes('//interest/@id') as T(N)
    
    0 讨论(0)
提交回复
热议问题