When joining three mysql tables, one record appears duplicated

1

As you can see, the problem is that the genres appear repeated, although the number of times that is repeated is correct

Note: I already solved the problem, the group by was the one that was interfering

SELECT serie_db.nombre,rating,GROUP_CONCAT(genero.nombre) FROM serie_db left join serie_db_generos on serie_db_generos.serie_db_id = serie_db.id left join genero on serie_db_generos.genero_id = genero.id group by serie_db_generos.serie_db_id
    
asked by dannygaray60 08.03.2017 в 16:59
source

1 answer

1

Missing add DISTINCT within GROUP_CONCAT

GROUP_CONCAT(DISTINCT genero.nombre)

A quick representation in FIDDLE of what you want to achieve: link

Note: Group by the id or name of the series to achieve the desired effect

    
answered by 08.03.2017 / 17:05
source