Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-22269

Mariadb lacks GROUPING() function

    XMLWordPrintable

    Details

      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

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            philip_38 Philip orleans
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.