MySQL merge duplicate rows -
i'm struggling query have make program:
this structure of table (example column names):
one id , name can have multiple coefficients, like:
id-name-coefficient 1-namehere-0.5 1-namehere-0.6 1-namehere-0.7
this how query result like:
1-namehere-0.5-0.6-0.7
so duplicate coefficnents, want in seperate columns, in 1 row.
what best way achieve query?
you can't have variable column count in sql, can concatenate values in 1 column:
select id, name, group_concat(coefficient) mytable group id, name
this return like
0.5,0.6,0.7
in third column can later parse on client.
Comments
Post a Comment