Oracle - select ID,wmsys.wm_concat(distinct ColumnName) ColumnName from table group by ID; MySQL - group_concat