|
-
Jun 8th, 2004, 05:49 AM
#1
Thread Starter
Frenzied Member
How to properly use WITH ROLLUP selecting from multiple fields?
I ahve a db question where I select like:
"SELECT a,b, c, d, e, f, SUM(f) AS sum_f FROM
whatever, whatever, LEFT OUTER JOIN etc etc
GROUP BY a, b, c, d,e,f WITH ROLLUP
Is this statement correct?
Because when I run the query without GROUP BY and rollup I get the column f (it's a quantity) like
a f
--------
car 4
bike 2
car 1
plane 1
rocket 2
But when I use group by and with rollup the f column stays the same the whole time... there must be something wrong with my query 
What I basically want to do is to group the resultset by a and sum it by f per group (and a grand total at the bottom)
kind regards
Henrik
car
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|