Bug #50945 I need to group the values in comma separated

Submitted: 5 Feb 2010 14:41 Modified: 5 Feb 2010 14:58
Reporter: Muthuraj M Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: General Severity:S2 (Serious)
Version:5.0.20-nt OS:Windows
Assigned to: CPU Architecture:Any
Tags: select command

[5 Feb 2010 14:41] Muthuraj M
Description:
I have the table like,

+--------------------------+--------------------------+
| First_Name               | Hobby                    |
+--------------------------+--------------------------+
| Tom                      | cricket                  |
| Tom                      | reading                  |
| Jerry                    | Gardening                |
| Jerry                    | movie                    |
| Jerry                    | reading                  |
+--------------------------+--------------------------+

I need to take the value like this,

+--------------------------+--------------------------+
| First_Name               | Hobby                    |
+--------------------------+--------------------------+
| Tom                      | cricket,reading          |
| Jerry                    | Gardening,movie,reading  |
+--------------------------+--------------------------+

How do i get it like this. Is there any query to get the values like this.

Please help me.....

How to repeat:
I have tried many way to get the result, but i can't. Is it possible to achieve with "select query" itself????

Please help me.... :(
[5 Feb 2010 14:58] Valeriy Kravchuk
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug. Check http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat on how to do what you need.

Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/

Thank you for your interest in MySQL.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.049 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.