title: sql sub and grand total
body: <p>Is there a nice consise way to get grand totals here-- this query shows sub totals for each day, but how can I get the grand total of each sub total without a sub query or another query</p>
  
  <p>also is there something better to use than compute sum? </p>
  
  <pre><code>SELECT loguser,logdate,logaction,logtime
  FROM log WHERE loguser IN
  ('scott')   AND logdate  
  BETWEEN '2011-06-01' AND '2011-06-15'   
  ORDER BY logdate DESC    
  COMPUTE SUM(logtime) BY logdate
  </code></pre>
  
  <p>SQL Server 2008 R2 </p>