Skip to content
Advertisement

Append values of other records for a distinct values of a column

if my database table is like:

now i want it as:

(I need distinct values of name and col-2 values must appended for the each distinct value of name) Both column values are of type text

Advertisement

Answer

This solved the requirement in MySQL

select name, group_concat(col-2) from dbo.sample group by name

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement