That title is presumably awfully worded. I have some PostgreSQL tables. There is a bridge table, that also holds extra data, so not strictly a bridge, but acts that way also. It goes something like so:
player_game
===========
player_game_id PK
player_id FK -> player
game_id FK -> game
other stuff.
I want to compile a list of all such game_ids that contain two players of my choice.
So I could find for example, games in which player 1234 played with player 9876.
There can be between 2 and 10 players in a game.
1 Answer