0

I have data something like this,

ID - Group_Concat
1 - aa,ab,ac,ad
2 - ab,ad,aa
3 - ad,ab,ac

Now I Want to get the result like this:

Group_Concat  -  Count
aa           -   2
ab           -  3
ac           -   2
ad           -   3
Strawberry
  • 33,750
  • 13
  • 40
  • 57
  • Can you write the sample data and expected result in proper columns instead? – jarlh Mar 26 '20 at 20:00
  • If I was going there, I wouldn't start from here :-( – Strawberry Mar 26 '20 at 20:12
  • It's really hard to split a comma-separated string in MySQL. You should normalize the data. – Barmar Mar 26 '20 at 20:17
  • 1
    `GROUP_CONCAT` is a MySQL aggregation function. If possible, find the source of this query to return to the unit level data to retrieve your counts. – Parfait Mar 26 '20 at 20:17
  • @Parfait I suspect he's not actually using `GROUP_CONCAT()`, he's just using that to describe a column that contains comma-separated data, in the format that `GROUP_CONCAT()` creates. – Barmar Mar 26 '20 at 20:18

0 Answers0