If I have a table with the following data in MySQL:
id Name Value 1 A 4 1 A 5 1 B 8 2
SELECT ID, GROUP_CONCAT(CONCAT_WS(':', NAME, VALUE) SEPARATOR ',') AS Result FROM test GROUP BY ID