title: SQL - Help on re-arranging data
body: <p>I have done a unpivot and this the result, row_number was added after unpivot using the <code>row_number()</code>.</p>
  
  <pre><code>Name    ID      Label       Value   Row_Number
  A       101     Label1      11          1
  A       101     Label2      20          2
  A       101     Label3      16          3
  B       102     Label1      17          1
  B       102     Label2      19          2
  B       102     Label3      12          3
  B       102     Label4      17          4
  C       103     Label1      15          1
  C       103     Label2      16          2
  </code></pre>
  
  <p>I need some help on removing the entire row where the row_number is 1 and adding only <code>Label</code> and <code>Value</code> columns value to a new column. Likely the result to be like the table below.</p>
  
  <pre><code>Name    ID      Label       Value   Row_Number  New Label   New Value
  A       101     Label2      20          2       Label1          11
  A       101     Label3      16          3           
  B       102     Label2      19          2       Label1          17
  B       102     Label3      12          3           
  B       102     Label4      17          4           
  C       103     Label2      16          2       Label1          15
  </code></pre>
  
  <p>I thought of doing this like, storing all the records where row_number >= 2 into a temp table. And the storing all the values where row_number = 1 into another temp table. And join the data using <code>Name</code> and <code>ID</code>.</p>
  
  <p>And at the same time, I was thinking that this isn't a robust way of doing it, any suggestion will help me whether I wanted to go this solution or is there any other better way of doing it.</p>
  
  <p>Thanks in advance.</p>