Skip to content Skip to sidebar Skip to footer

Split Row Results To Column

I am trying to create a query that pulls all customer info from our database, but because there are often multiple contact persons behind 1 company, I get the same company listed i

Solution 1:

Try this...

SELECT Customer.Company,GROUP_CONCAT(Customer.ContactPerson) AS'AllContactPerson'FROM Customer GROUPBY Customer.Company

this will give you as under result (if ContactPerson details comes from Customer table. )

Company    |   AllContactPerson 
--------------------------------
Company 1  |   Alex,Tom         

Post a Comment for "Split Row Results To Column"