title: Split space separated values
body: <p>I have many records like this</p>
  
  <pre><code>ID   Tag   Arr
  1    A     87 34 92
  2    A     34 35 38
  3    A     39 88 92
  4    B     24 49 39
  5    B     38 88 23
  6    C     39 37 99
  </code></pre>
  
  <p>I want the end result to look like this in a fast way</p>
  
  <pre><code>Tag Arr No
  A   87  1
  A   34  2
  A   92  2
  A   35  1
  A   38  1
  A   39  1
  A   88  1
  B   24  1
  B   49  1
  B   39  1
  B   38  1
  B   88  1
  B   23  1
  C   39  1
  C   37  1
  C   99  1
  </code></pre>
  
  <p>This is the query i built so far</p>
  
  <pre><code>SELECT DISTINCT T2.tag, 
      SUBSTRING(
          (
              SELECT ','+T1.Arr  AS [text()]
              FROM Tags T1
              WHERE T1.tag = T2.tag
              and filename = 1
              and tag not in ('U')
              ORDER BY T1.tag
              FOR XML PATH ('')
          ), 2, 1000) [Ts]
  FROM Tags T2
  WHERE  filename = 1
  and tag not in ('U')
  </code></pre>