I have following data structure in MySQL database:
{
date: text
name: text
}
and a data set:
"2016-01-01" "a1"
"2016-01-02" "a2"
"2016-01-02" "a3"
"2016-01-03" "a4"
I would like to combine "name" field, if the "date" is a same in different rows. So at the end to have something like:
"2016-01-01" "a1"
"2016-01-02" "a2, a3"
"2016-01-03" "a4"
Of course I could iterate over results-array and build a new structure, like this one, programmatically.. but maybe its a faster way to do this directly in SQL Query?