Advertisement
Armandobs14

Concatenando Strings GROUP_BY

Mar 5th, 2014
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.27 KB | None | 0 0
  1. # Concatenando strings usando "," (virgula) como separador
  2.  
  3. SELECT tabela1.atributo,GROUP_CONCAT(tabela2.atributo SEPARATOR ',') FROM banco.tabelaN_N INNER JOIN classes ON tabelaN_N.tabela2_id = tabela2.id INNER JOIN tabela1 ON tabela1_id = tabela1.id GROUP BY tabela1.id;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement