I have the following data in database
ID | AId | field | Value | internalOrder |
-------------------------------------------------------------------------
| 86 | 193 | h1 | v1 | 1 |
| 43 | 193 | default | default | 2 |
I want to get concatenated field,value and internalOrder sorted by internalOrder groupedBy Aid. So that the results should be like
193 | h1,default | v1,default | 1,2
I have tried few things.
select Aid,group_concat(field), group_concat(value), group_concat(internalOrder order by internalOrder ASC) from table1 group by Aid order by Aid;
This produces results like this:
|193 | default,h1 | default,v1 | 1,2
Which is wrong.
How to produce the desired results?