Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-958

expressions on group by columns in select list not supported

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Won't Do
    • 1.0.11
    • Icebox
    • ExeMgr
    • None

    Description

      it is technically valid to have the following query:

      MariaDB [test]> select y, substr(c,1,2), count(*) from o1 group by y,c;
      ERROR 1815 (HY000): Internal error: IDB-2021: 'substr(c,1,2)' is not in GROUP BY clause. All non-aggregate columns in the SELECT and ORDER BY clause must be included in the GROUP BY clause.
      

      the intent of this would be to group by y,c then apply the substr expression on the resulting group by columns.

      A workaround is to move the group by to a subquery and apply the substr in the outer sql:

      select y, substr(c, 1,2) c, cnt from (select y, c, count(*) cnt from o1 group by y,c) t;
      

      Attachments

        Activity

          People

            toddstoffel Todd Stoffel (Inactive)
            dthompson David Thompson (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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