Discussion:
agregation function - list all values of column in 1 column
(too old to reply)
HMarinho
2009-05-26 12:59:21 UTC
Permalink
hi.
I dont know mysql and agregation functions, but i need list ALL values
of column 'name' with agregation 'groupp'.

id..|..groupp.|..name
---------------------------------
1...|..cool....|..Helton
2...|..cool....|..Bob
3...|..good...|..Patrick
4...|..good...|..Lisa
5...|..none...|..Martin

i need to return in the following format:
SELECT groupp, LIST_NAMES_HERE(name)
FROM table
GROUP BY groupp

group..|..LIST_NAMES_HERE(name)
---------------------------------
cool....|..Helton, Bob
good...|..Patrick, Lisa
none...|..Martin

it is possible with mysql? suggestion?
thanks
HMarinho
2009-05-26 14:49:20 UTC
Permalink
Post by HMarinho
hi.
I dont know mysql and agregation functions, but i need list ALL values
of column 'name' with agregation 'groupp'.
id..|..groupp.|..name
---------------------------------
1...|..cool....|..Helton
2...|..cool....|..Bob
3...|..good...|..Patrick
4...|..good...|..Lisa
5...|..none...|..Martin
SELECT groupp, LIST_NAMES_HERE(name)
FROM table
GROUP BY groupp
group..|..LIST_NAMES_HERE(name)
---------------------------------
cool....|..Helton, Bob
good...|..Patrick, Lisa
none...|..Martin
it is possible with mysql? suggestion?
thanks
group_concat(expr)

Loading...