Join SQL columns data

0

In the following example:

Could you merge the genre into a single column?

For example:

podcast = 1, Genre = Music, Fiction.

podcast = 2, Genre = Art, Videogames, Politics.

    
asked by InThaHouse 21.05.2018 в 22:36
source

1 answer

1

If you can, for that you require the GROUP_CONCAT command and the syntax would be the following:

SELECT
   idPodcast, GROUP_CONCAT(genero) 
FROM 
   generos 
GROUP BY
   idPodcast
    
answered by 21.05.2018 / 22:43
source