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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -