concatenate data from column year when GROUP BY on Column Amount (MySQL)
-1
votes
1
answer
39
views
I have a table from which I generate a view Grouping By Year and summing the amounts, and I wonder if I could somehow include a "string sum" or "string concatenation" of the aggregated dates or months.
Example: this is the base table
ID | date | year | month | amount
This is the actual view
ID | year | sum(amount)
what I am looking for is an additional field with concatenates the months to 03,05,11 (for example or to something similar), if a year aggregates data from march, may and november
ID | year | sum(amount) | list_of_months
Is that possible or do I have to create helping views to aggregate that?
Edit: I was able to answer myself: Group_concat to the help as shown in the answer below
Asked by Canelo Digital
(139 rep)
Oct 31, 2024, 03:41 PM
Last activity: Nov 1, 2024, 04:06 PM
Last activity: Nov 1, 2024, 04:06 PM