I have the following tables and I want to display all the genres for one game on one row. There is a game
table with a GameID and GameTitle:
genre Table
GenreID Genre_Name
----------------------
1 Action
2 Third Person
3 Open World
game_genre table
GameGameID GenreGenreID
-------------------------
197 1
197 2
197 3
This is the result I got:
GameID GameTitle Genre
-------------------------------------
197 Watch Dogs Third Person
197 Watch Dogs Action
197 Watch Dogs Open World
Query:
SELECT *, GROUP_CONCAT(Genre_Name)
FROM game
JOIN game_genre ON game.GameID = game_genre.GameGameID
JOIN genre ON game_genre.GenreGenreID = genre.GenreID`
How do I get a the table to appear like this?
GameID GameTitle Genre
--------------------------------------------------------------------
197 Watch Dogs Third Person, Action, Open World