Skip to content

GROUP_CONCAT isn't fully supported #2413

@4skinSkywalker

Description

@4skinSkywalker

I'm testing the following operation on my app

SELECT GROUP_CONCAT(
    DISTINCT country  
    ORDER BY country ASC SEPARATOR ';'
) as countries
FROM diary;

and it leads to an error: error: Parse error on line 4: ...TINCT country ORDER BY country AS ----------------------^ Expecting 'EOF', 'COMMA', 'RPAR', 'IN', 'LIKE', 'ARROW', 'DOT', 'CARET', 'EQ', 'SLASH', 'EXCLAMATION', 'MODULO', 'GT', 'LT', 'GTGT', 'LTLT', 'NOT', 'AND', 'OR', 'PLUS', 'STAR', 'RBRA', 'END', 'ELSE', 'REGEXP', 'TILDA', 'GLOB', 'NOT_LIKE', 'BARBAR', 'MINUS', 'AMPERSAND', 'BAR', 'GE', 'LE', 'EQEQ', 'EQEQEQ', 'NE', 'NEEQEQ', 'NEEQEQEQ', 'BETWEEN', 'NOT_BETWEEN', 'IS', 'DOUBLECOLON', 'GO', 'SEMICOLON', got 'ORDER'

Do you plan supporting it?

P.S.: In the meanwhile I've solved it by using

SELECT REPLACE(GROUP_CONCAT(country), ',', ';') AS countries
FROM (
    SELECT DISTINCT country
    FROM diary
    ORDER BY country
);

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions