Advertisement
badlogic

Concatenate fields of rows with the same ID in MySQL

Nov 11th, 2016
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. http://stackoverflow.com/questions/28986135/concatenate-fields-of-rows-with-the-same-id-in-mysql
  2.  
  3. SELECT m.id, GROUP_CONCAT(distinct(g.loc))
  4. FROM mutations m JOIN
  5. genes g
  6. ON m.id = g.id
  7. GROUP BY m.id;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement