Smile.Hunter Smile.Hunter - 2 months ago 8
MySQL Question

MySQL query: merge result of many rows into 1 row

I want to use MySQL query to merge result of many rows into 1 row by appending next record to the first one until the end of result, is it possible? I do not want to use any other application to process this task, any SQL geeks here?

Answer

TRY GROUP_CONCAT

Select 

GROUP_CONCAT(column SEPARATOR ',')
from myTABLE
GROUP BY PKCOlumn