title: MSSQL Select Distinct and Sorting
body: <p>I have a query which returns distinct records on 2 columns, however I need to sort the results on those 2 columnns and 1 additional column.
  When I try the SQL below I get the error shown.</p>
  
  <p>SQL:</p>
  
  <pre><code>SELECT DISTINCT vers, revs FROM tblMVer 
  WHERE mid = 194 ORDER BY date_deployed DESC, vers DESC, revs DESC
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>ORDER BY items must appear in the select list if SELECT DISTINCT is specified.
  </code></pre>
  
  <p>Any ideas on how to achieve this please.</p>
  
  <p>Thanks</p>
  
  <p>Kev</p>