title: Rank the number of orders in reverse
body: <p>First, thanks for looking. I don't post a lot of questions as I can usually find an answer but this one is making me wonder if I am doing something wrong.</p>
  
  <p>SQL Server 2008 (although this server will be upgraded to 2016 soon).</p>
  
  <p>Don't know if this can even be done, so that's why I am asking. I am trying to rank orders and assign points to the person with the most orders. Highest person gets 10 pts, next is 9 pts, etc. etc. </p>
  
  <p>Here is what I have</p>
  
  <pre><code>Salesperson       Orders     TotalSales
  ---------------------------------------
  5695              270        23500
  8475              310        46000
  1287              105         9000
  5412              475        75600
  </code></pre>
  
  <p>What I would like to see is this</p>
  
  <pre><code>Salesperson       Orders     TotalSales     Ranking
  ---------------------------------------------------
  5412              475        75600             10
  8475              310        46000              9
  5695              270        23500              8
  1287              105         9000              7
  </code></pre>
  
  <p>and so on and so on...</p>
  
  <p>I'm trying the following, but its all I know about RANK</p>
  
  <pre><code>SELECT 
      Salesperson,
      RANK() OVER (PARTITION BY Orders ORDER BY ORDERS DESC),
      TotalSales
  FROM 
      OrdersTable
  </code></pre>
  
  <p>Any help is greatly appreciated!!</p>