SQL Grouping Acct Numbers and Getting Subtotals and Grand Total
问题 This query... SELECT ACTNO,SUM(PLAN) AS 'TOTAL PLAN', SUM(FORECAST) AS 'TOTAL FORECAST' FROM COST_CENTER GROUP BY ACTNO I get the following results: ACTNO | TOTAL PLAN | TOTAL FORECAST 100 | 12000 | 20000 101 | 12000 | 20000 200 | 1000 | 1500 201 | 1200 | 2000 202 | 900 | 1500 203 | 700 | 1500 220 | 1500 | 3500 300 | 1200 | 2000 301 | 1000 | 3000 I need to group together certain accounts, get those groups' subtotals, and then add all the subtotals up for a grand total. The desired result