php - Concat multiple row and column in single row mysql -
i have table containing data in following format id | name | age ---------------------------- 1 | john | 24 2 | sam | null 3 | ron | 32 4 | harry | 44 now want fetch 1 row 1:john:24,2:sam,3:ron:32,4:harry:44 i have tried group_concat gives me 1 columns values separated comma, possible in mysql ? use group_concat , concat together: select group_concat(concat(id, ':', name, ':', ifnull(age,''))) table1 you can ":" moved over select group_concat(concat(id, ':', name, ifnull(concat(':',age),''))) table1 and here's updated sqlfiddle hims056 created.