Problem Description
In short: Is there any way to sort the values in a GROUP_CONCAT statement?
Query:
GROUP_CONCAT((SELECT GROUP_CONCAT(parent.name SEPARATOR " » ")
FROM test_competence AS node, test_competence AS parent
WHERE node.lft BETWEEN parent.lft AND parent.rgt
AND node.id = l.competence
AND parent.id != 1
ORDER BY parent.lft) SEPARATOR "<br />\n") AS competences
I get this row:
> Crafts &raquo; Joinery
>
> Administration &raquo; Organization
I want it like this:
> Administration &raquo; Organization
>
> Crafts &raquo; Joinery
AI-Generated Solution
Powered by LMSouq AI · GPT-4.1-mini
Analyzing problem and generating solution…
Was this solution helpful?