José
José

Reputation: 5

mysql GROUP_CONCAT with multiple columns

I want to do a group concat with multiple columns inside it. This is the query I have(I want to know if it is possible, and if not, what other way can I do this?:

select  group.groupname, 
        group_concat(machine.machinename,'--',machine.machineModel) 
    inner join etc....

Upvotes: 0

Views: 3172

Answers (1)

Rams
Rams

Reputation: 2169

You need to first concatenate those values and then do group_concat.

select  group.groupname, 
        group_concat(machine.machinename||'--'||machine.machineModel)) 
    inner join etc....

Upvotes: 1

Related Questions