0

SQL Server 2005/2008 xml/xquery を使用しています。<all>次の xml があり、これらを除くすべての要素を に返したいと考えてい<except>ます。

declare @x xml = '
<except>
  <x>1</x>
  <x>4</x>
</except>
<all>
  <x>1</x>
  <x>2</x>
  <x>3</x>
  <x>4</x>
</all>'
select @x.query('for $x in /all return $x') 
-- How to except the elements in <except>?

期待される結果: <x>2</x><x>3</x>

4

1 に答える 1