Oracle answer.
Re: displaying a group by and grand total all on one line?
Below is more conceptual than actual code since I'm in a big rush right now, but I believe the quickest way to obtain results for you would be a subselect. Using a subselect would allow you total without grouping by all the other columns that would force the group by.
SELECT sum(TABLE1.COLUMN1), TABLE1.INDEXCOLUMN, TABLE1.SOMEOTHERDATA, TABLE2.GRANDTOTAL
FROM TABLE1,
( SELECT sum(TABLE1.COLUMN1) AS "GRANDTOTAL",
FROM TABLE1 ) TABLE2
WHERE...
GROUP BY TABLE1.INDEXCOLUMN, TABLE1.SOMEOTHERDATA, null AS GRANDTOTAL
|