View Single Post
  #2 (permalink)  
Old 10-03-2006, 08:48 AM
Josh Dunlavy
 
Posts: n/a
Default 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
Edit/Delete Message Reply With Quote