Question : Looking for help summarizing data... GROUP BY ROLLUP()??

I'm trying to summarize some data based upon ACCOUNT but I'm having problems getting this to work, I'm hoping someone can help me out.

Essentially I would like to be able to summarize the attached information by ACCOUNT with a TOTAL amount for ACCOUNT, I thought ROLLUP() was going to help but I'm able to get it to work.

I have also supplied what I'm expecting for the results.

Thanks for any help you can give.

NG,
Attachments:
 
Test Data
 
 
Test Data Result
 

Answer : Looking for help summarizing data... GROUP BY ROLLUP()??

Slight correction here:

Create a UNION of 2 SELECT statements..

SELECT #1: Grab all detail, but convert all columns EXCEPT Amount to character type

SELECT #2: Do the SUM, GROUP BY.. in this one, select '' (empty string) for all blank columns.

Your order by will be 1,2,3,4,5, etc.
Random Solutions  
 
programming4us programming4us