Link to home
Start Free TrialLog in
Avatar of mrroy69
mrroy69

asked on

MySQL Combine/Merge Multiple Rows With same Colum Name and Group by Username

I have a table with the following fields: Username | Occupation | Skills

There are multiple rows from the same user

SELECT * FROM TABLE ORDER BY username gives the following results

User1 | Teacher | Photoshop, Wordpress
User1 | Cashier | CMS
User1 | Painter | Carpentry
User2 | Cashier | Drupal, Window Washing
User2 | Captain | Flying
User2 | Driver | Loading
User3 | Technician | Software, Windows
User3 | Technician II | Hardware

I don't know if it's possible but I would like to find a query that can merge/combine rows with the same column name so that the result would be like below.

WANTED RESULT

User1 | Teacher, Cashier, Painter | Photoshop, Wordpress, CMS, Carpentry
User2 | Cashier, Captain, Driver | Drupal, Window Washing, Flying, Loading
User3 | Technician, Technician II | Software, Windows, Hardware
ASKER CERTIFIED SOLUTION
Avatar of Sharath S
Sharath S
Flag of United States of America 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 mrroy69
mrroy69

ASKER

Thank you Sarah!
Avatar of mrroy69

ASKER

Awesome thanks!