Description\n-----------\n\nThe WITH ROLLUP modifier adds extra rows to the result set that represent super-aggregate summaries. The super-aggregated column is represented by a NULL value. Multiple aggregates over different columns will be added if there are multiple GROUP BY columns.\n\nThe LIMIT clause can be used at the same time, and is applied after the WITH ROLLUP rows have been added.\n\nWITH ROLLUP cannot be used with ORDER BY. Some sorting is still possible by using ASC or DESC clauses with the GROUP BY column, although the super-aggregate rows will always be added last.\n\nExamples\n--------\n\nCREATE TABLE booksales ( \n  country VARCHAR(35), genre ENUM('fiction','non-fiction'), year YEAR, sales INT);\n\nINSERT INTO booksales VALUES\n  ('Senegal','fiction',2014,12234), ('Senegal','fiction',2015,15647),\n  ('Senegal','non-fiction',2014,64980), ('Senegal','non-fiction',2015,78901),\n  ('Paraguay','fiction',2014,87970), ('Paraguay','fiction',2015,76940),\n  ('Paraguay','non-fiction',2014,8760), ('Paraguay','non-fiction',2015,9030);\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/selecting-data/select-with-rollup