How to select all the column values corresponding to duplicate values in different column of a table using flask ORM?

Solution
select customer_id, STRING_AGG(mean_value, ',' order by mean_value) means
from mytable group by customer_id order by customer_id;
select concat('{', customer_id, ': ', '[', STRING_AGG(mean_value, ',' order by mean_value), ']}') output
from mytable group by customer_id order by customer_id;