In MySQL I'm trying to sum up a column but retain the row IDs. When I do a sum, the IDs are compressed and the result is
1 | 1500
What I would like is
1,2,3 | 1500
In MySQL I'm trying to sum up a column but retain the row IDs. When I do a sum, the IDs are compressed and the result is
1 | 1500
What I would like is
1,2,3 | 1500
SELECT GROUP_CONCAT(id), SUM(value) FROM table
SELECT GROUP_CONCAT(id), SUM(column_name) FROM table_name GROUP BY id