Link to home
Start Free TrialLog in
Avatar of detox1978
detox1978Flag for United Kingdom of Great Britain and Northern Ireland

asked on

MySQL / PHP help

Hi All,

I have the following MySQL table

ID    Customer     Contact
1     ABC Ltd         John Smith
2     ABC Ltd         Joe Bloggs
3     XYZ Ltd         Tom Jones
4     XYZ Ltd         Andy Murray

Open in new window


I need to get this into an new table as

ID    Customer     Contact
1     ABC Ltd         John Smith,Joe Bloggs
2     XYZ Ltd         Tom Jones,Andy Murray

Open in new window



Any suggestions?
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland 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 detox1978

ASKER

I just needed to change the GROUP BY to customer and it worked perfectly.  Thanks
Oops yes
Any MySQL book by Vikram Vaswani will give you a good foundation.  I have an older one (MySQL 4) and it still covers almost everything I need to do!
http://mysql-tcr.com/book/