sqlbelle.wordpress.com
Getting Grand Total and Subtotals using SQL Server Window Functions
Did you know that you can use SQL Server’s window function in an aggregate, and partition by NULL to get a grand total? Let me illustrate. In the example below I use my trusty ol’ pubs …