Q:

SQL Grouing and sub-totaling

I have the below query:-
SELECT 
FISCALYEAR, 
DATENAME(Month,JVDate) as Month,
ACCOUNTNUMBER,
ACCOUNTDESCRIPTION, 
CATEGORY, 
POSTINGTYPE,
ORIGNETAMOUNT, 
FROM dbo.vw_GLTrialBalancev2010 INNER JOIN
                        GL00100 ON GL00100.ACTNUMBR_1 = dbo.vw_GLTrialBalancev2010.SEGMENT1 AND GL00100.ACTNUMBR_2 = dbo.vw_GLTrialBalancev2010.SEGMENT2

That displays the below results:-

Can anyone show me a way to group and then subtotal by Category.
I would like to see something like the below:-

All help greatly appreciated.

A:

SELECT 
  FISCALYEAR, 
  DATENAME(Month,JVDate) as Month,
  ACCOUNTNUMBER,
  ACCOUNTDESCRIPTION, 
  CATEGORY, 
  POSTINGTYPE,
  sum(ORIGNETAMOUNT) as ORIGNETAMOUNT, 
FROM dbo.vw_GLTrialBalancev2010 
INNER JOIN GL00100 
        ON GL00100.ACTNUMBR_1 = dbo.vw_GLTrialBalancev2010.SEGMENT1 
        AND GL00100.ACTNUMBR_2 = dbo.vw_GLTrialBalancev2010.SEGMENT2
group by FISCALYEAR, DATENAME(Month,JVDate) as Month, ACCOUNTNUMBER, 
         ACCOUNTDESCRIPTION, CATEGORY, POSTINGTYPE

