Sub total & total with aggregate
<p>I need to extend my sql query that returns sub totals &amp; totals. Is there a way to return both sub totals and grand total with this query:</p>

<p>I have data like this:</p>

<pre><code>Department Employee Sal
A          Jack     1000          
A          Pack     1000          
A          Dack     1000          
B          BEN     1000          
B          HEN     1000          
C          SIN     1000   
</code></pre>

<p>I Want this, i.e Subtotal &amp; Total for all the Department        </p>

<pre><code>Department Employee Sal
A          Jack     1000          
A          Pack     1000          
A          Dack     1000      
A_Sub_Total         3000      
B          BEN      1000          
B          MAT      1000          
B_Sub_Total         2000      
C          SIN      1000  
C_Sub_Total         1000    
Total               6000 
</code></pre>

<p>I tried to use compute function i.e "Compute Sum(Sal) by Department"
it is not working</p>