Link to home
Start Free TrialLog in
Avatar of GreatSolutions
GreatSolutionsFlag for Israel

asked on

How to retrieve distinct values from concat field in a group by query

Hi
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"

Open in new window


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"

Open in new window


How can i do that?
Thanks
Jaime
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GreatSolutions

ASKER

Many thanks for the fast response!
It gave me duplicates inside the field, but group_concat ( distinct ConcatField ) did the trick!

Jaime