Search code examples
mysqlsumsummary

sum as comma separated on MySQL table


I have a MySQL view which has "sum" and "group by" functions. It's getting total price for each customer by customer name, I want to make this to sum for pieces that ordered, not as different numeric columns but as comma separated text data on single cell.


Solution

  • Use CONCAT(SUM(COLA), ', ', SUM(COLB), ', ', ...)