title: Simple SQL select sum and values of same column
body: <p>I have a co-worker who is working on a table with an 'amount' column.
  They would like to get the top 5 amounts and the sum of the amounts in the same query.</p>
  
  <p>I know you could do this:</p>
  
  <pre><code>SELECT TOP 5 amount FROM table 
  UNION SELECT SUM(amount) FROM table
  ORDER BY amount DESC
  </code></pre>
  
  <p>But this produces results like this:</p>
  
  <pre><code>1000  (sum)
   100
    70
    50
    30
    20
  </code></pre>
  
  <p>When what they really need is this:</p>
  
  <pre><code>100 | 1000
   70 | 1000
   50 | 1000
   30 | 1000
   20 | 1000
  </code></pre>
  
  <p>My intuitive attempts to achieve this tend to run into grouping problems, which isn't such an issue when you are selecting a different column, but is when you want to use an aggregate function based on the column you are selecting.</p>