Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
Description
MySQL 8 already allows this:
Using GROUPING() to substitute labels for the super-aggregate NULL values makes the result easier to interpret:
SELECT
IF(GROUPING(name) = 1, 'All items', name) AS name,
IF(GROUPING(size) = 1, 'All sizes', size) AS size,
SUM(quantity) AS quantity
FROM t1
GROUP BY name, size WITH ROLLUP;
This is an old feature of MsSQL. Over the years I have filed a few times a request so MariaDB fixes this problem because we cannot return nulls in the grouping cells, we need to add a meaningful label. Please stop procrastinating and listen to the business people. We cannot work efficiently as it is.
https://dev.mysql.com/doc/refman/8.0/en/group-by-modifiers.html
Attachments
Issue Links
- is duplicated by
-
MDEV-32789 Add GROUPING function
- Closed
- is part of
-
MDEV-28906 MySQL 8.0 desired compatibility
- Open