title: Query to merge 2 rows from one column into 1 row with 2 columns
body: <p>I need to process a querystring and create records out of them.</p>
  
  <p>Originally the format was an escaped string in this format:</p>
  
  <pre><code>relativeFilePath1^relativeFilePath2^relativeFilePath3^relativeFilePath4
  </code></pre>
  
  <p>where the ^ character was escaped with %5E. Is used to split the string at this posistion, created a temporary table, inserted everything in it and fired a Insert into from there.</p>
  
  <pre><code>DECLARE @SplittetList TABLE(ID int Identity(1,1), fPath nvarchar(max));
  INSERT INTO @SplittetList SELECT * FROM Schema.fnSplit('relativeFilePath1%5ErelativeFilePath2%5ErelativeFilePath3%5ErelativeFilePath4', '%5E')
  --additional processing
  </code></pre>
  
  <p>Now the format is about to change so that after every file path, there is also additional field of metadata to this file, also seperated with a ^ character. If I split this now I am getting a result like this:</p>
  
  <pre><code>ID |  fPath
  ---------------------
  1  |  relativeFilePath1
  2  |  metadata1
  3  |  relativeFilePath2
  4  |  metadata2
  5  |  relativeFilePath3
  6  |  metadata3
  n  |  ...
  </code></pre>
  
  <p>How can I transform this list, so that the result is a set of data in this format:</p>
  
  <pre><code>filepath           |     metadata
  ----------------------------------
  relativeFilePath1  |     metadata1
  relativeFilePath2  |     metadata2
  relativeFilePath3  |     metadata3
  ...
  </code></pre>