Query help

I'm trying to adjust the following query—which works—in order to know if a player belongs to, or has joined, each game in the result set.
select 
 games.name AS game,
 profiles.name AS organizer
 from games 

left join profiles on games.organizer_id = profiles.id

where games.organizer_id = 'f316de4e-e478-4ce3-842c-00e98f475870'
or games.organizer_id in (select friends.friend_id from friends where friends.user_id = 'f316de4e-e478-4ce3-842c-00e98f475870' and friends.accepted = true)
or games.id in (select players.game_id from players where players.user_id = 'f316de4e-e478-4ce3-842c-00e98f475870')
order by games.datetime asc
;

Not sure how to proceed. Like, I think I need to do a count(players.id) and add a where clause that matches the user id...
Was this page helpful?