mariadb json_arrayagg не существует
SELECT column1, CONCAT('[', GROUP_CONCAT(column2), ']') AS column2 FROM table GROUP BY column1;
Alberto Peripolli
SELECT column1, CONCAT('[', GROUP_CONCAT(column2), ']') AS column2 FROM table GROUP BY column1;