title: Combine multiple rows into one in SQL
body: <p>In sql server 2008, I have a table that has the columns [a],[b],[c],[sort] and it has 4 records:</p>
  
  <pre><code>1,      NULL,  NULL    0
  NULL,   2,     NULL    1
  NULL,   NULL,  3       2
  10,     NULL,  NULL    3
  </code></pre>
  
  <p>I need to combine all the rows in a way that i get one row as a result, and for each column I get the first (ordered by sort column) non-null value. So my result should be:</p>
  
  <pre><code>1,      2,     3
  </code></pre>
  
  <p>Can anyone suggest how to do this?
  Thanks</p>