title: T-SQL: Conditional sorting on two columns
body: <p>I have a table, TableA, that looks like this:</p>
  
  <pre><code>ColA    ColB
  0        20
  1        10
  0        5
  1        15
  </code></pre>
  
  <p>I want to sort the rows so that all the records where ColA = 0 are listed first, and then these records are sorted by ColB ascendingly. After all the rows with ColA = 0 are listed, I then want to list all the rows with ColA = 1 but these rows sorted by ColB descendingly.</p>
  
  <p>The results should look like this:</p>
  
  <pre><code>ColA    ColB
  0        5
  0        20
  1        15
  1        10
  </code></pre>
  
  <p>Is this possible? Thanks for your help.</p>