Created
June 24, 2017 17:51
-
-
Save LeandroLS/1d5cfdd71843380ae630b1802bb499f0 to your computer and use it in GitHub Desktop.
Post GROUP_CONCAT() no MYSQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
GROUP_CONCAT(contas.nome) AS contas, | |
classificacao.nome AS classificacao | |
FROM | |
contas | |
INNER JOIN | |
classificacao ON classificacao.id = contas.id_classificacao | |
GROUP BY classificacao.nome; | |
+------------------------------------------------------------+---------------+ | |
| contas | classificacao | | |
+------------------------------------------------------------+---------------+ | |
| Conta de água,Conta de luz,Jogos da Steam | despesa | | |
| Rendimento de investimentos,Recebimento de aluguel,Salario | receita | | |
+------------------------------------------------------------+---------------+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment