Here is my current query (confidential data replaced and where clauses removed for simplicity):
select a.id, group_concat(v.value) from asset a, values v where a.id=v.id group by a.case_id;
The current results appear as:
a.id v.value
123 a,b
234 a
456 a,b,c
789 d,e
237 a
What I want it to do is group by and count the results of the group_concat, so it should look like:
v.value count
a,b 1
a 2
a,b,c 1
d,e 1
I have tried unsuccessfully to group on the field name I give to the group_concat, it keeps on saying 'unable to group by 'name'
I have to do this directly in the query not in the code. Any suggestions?