GreatSolutions
asked on
How to retrieve distinct values from concat field in a group by query
Hi
Assuming the following rows in my table:
I would like to run a query grouped by field1 and showing count(ID), sum(field2) and a field with all values in the concatfield, i.e
How can i do that?
Thanks
Jaime
Assuming the following rows in my table:
ID , Field1, Field2, ConcatField
1 , "test", 3, "a,b"
2 , "tttt", 2, "a,c,d"
3 , "test", 8, "a"
4, "test", 1, "d"
I would like to run a query grouped by field1 and showing count(ID), sum(field2) and a field with all values in the concatfield, i.e
Field1, Count, Sum, ConcatField
"test", 3, 12, "a,b,d"
"tttt", 1, 2, "a,c,d"
How can i do that?
Thanks
Jaime
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It gave me duplicates inside the field, but group_concat ( distinct ConcatField ) did the trick!
Jaime