Skip to content

Tag: oracle12c

Combining MAX and SUM in an Oracle ROLLUP

Here’s my SQL: The output looks like this: I was expecting it to look like this: In other words, I was expecting the rollup to sum up the maximum weights of each food instead of taking the maximum of all the maximums in the food-type category. I do have a solution of sorts, but it means having to add an