title: Create a grand total row in sql server
body: <p>I'm writing a query where in there should be a total row at the end of the table that gives the sum of the <code>closed</code> , <code>open</code>, <code>reassigned columns</code>. </p>
  
  <p>I'm able to make a pivot, but unable to know how to place a row in the end. I've searched online but mostly found solutions for creating a column and a row or just column. I'm into Dev, dunno much about the databases. below is my pivot. please let me know how can i do this.</p>
  
  <pre><code>select *
  from 
  (
    select [case owner] as AGENT, [final status]
    from StatusTable
  ) src
  pivot
  (
    count([final status])
    for [final status] in ([CLOSED], [OPEN], [REASSIGNED])
  ) piv
  </code></pre>
  
  <p>The current output is as below image </p>
  
  <p><a href="https://i.stack.imgur.com/gvYFD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gvYFD.png" alt="enter image description here"></a></p>
  
  <p>And here I want an extra row as shown below.</p>
  
  <pre><code>TOTAL | 2 | 8 | 2
  </code></pre>