Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-5083

add ORDER BY clause to GROUP_CONCAT()

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Backend, Frontend
    • Epic Color:
      ghx-label-9

      Description

      Currently GROUP_CONCAT() does not allow one to return an ordered result. The MySQL version does support this:

      GROUP_CONCAT([DISTINCT] expr [,expr ...]
                   [ORDER BY {unsigned_integer | col_name | expr}
                       [ASC | DESC] [,col_name ...]]
                   [SEPARATOR str_val])
      

      https://dev.mysql.com/doc/refman/8.0/en/group-by-functions.html#function_group-concat

      For example:

      mysql> SELECT student_name,
          ->     GROUP_CONCAT(DISTINCT test_score
          ->               ORDER BY test_score DESC SEPARATOR ' ')
          ->     FROM student
          ->     GROUP BY student_name;
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                grahn Greg Rahn
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: