I'm having a problem when I make a SELECT
in my DB, I'm using GROUP_CONCAT
to concatenate the phone and email column but I'm getting repeated data.
Here is SELECT
:
SELECT contatos.cont_id
, contatos.cont_firstname
, contatos.cont_lastname
, contatos.data_nasc
, contatos.anotacoes
, GROUP_CONCAT(contatos_email.email)
, contatos_telefone.telefone
, contato_endereco.rua
, contato_endereco.numero
, contato_endereco.bairro
, contato_endereco.cidade
, contato_endereco.estado
, contato_endereco.pais
FROM contatos
JOIN contatos_email ON contatos.cont_id = contatos_email.contato_id
JOIN contatos_telefone ON contatos.cont_id = contatos_email.contato_id
JOIN contato_endereco ON contatos.cont_id = contato_endereco.contato_id
In the column in which the emails are being displayed, it was only for 3 emails to appear and not repeat as it is now ...