Here's my working query:
SELECT
d.*, g.name game,
(SELECT GROUP_CONCAT(p.name) FROM shows_players p
LEFT JOIN (SELECT * FROM shows_map) sm ON sm.player_id = p.id
WHERE sm.show_id = d.id AND sm.game_id = g.id) players
FROM shows_dates d
LEFT JOIN (SELECT * FROM shows_map
WHERE player_id = 5 GROUP BY show_id, game_id) m ON d.id = m.show_id
LEFT JOIN shows_games g ON g.id = m.game_id
It's a fine query until adding the "WHERE player_id =" line. Then it returns some rows with no data. How do I clean this up and get rid of these?
Thank you