php - Group by one column and Show all results from another column -


hi guys trying solve , can't find solution.

i have 2 columns, trying make select , group first column , display records second column. table is:

regno   name c117    mariya mathew c117    baino baby c117    mathews reji c120    nithin abraham c120    vipin saji c120    veetu thomman 

so results supposed be:

c117  mariya mathew, baino baby, mathews reji c120  nithin abraham, vipin saji, veetu thomman 

kindly me...thanks in advance...

use group_concat

select regno, group_concat(name separator ', ') names mytable group regno 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -