Skip to content
Advertisement

Use ROLLUP with ORDER BY clause moves the Grand Total row from the bottom to the top

Here’s the schema: enter image description here

This works:

This works

However, when I add an ORDER BY clause, the Grand Total row moves from the bottom. I understand the first example has the rows sorted by Genre but I wonder why adding the clause breaks it. enter image description here

Advertisement

Answer

You can use multiple keys for the order by:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement