gamingmouse
Programmer
My database contains poker data with the following relevant colums (I've included sample data):
[tt]
game_id player_id number_of_players pf_raise saw_flop
21 2 4 0 1
21 8 4 0 1
21 372 4 0 0
21 76 4 1 1
[/tt]
game_id and player_id are globally unique.
number_of_players tells us how many players were dealt cards for that game_id.
pf_raise is boolean -- tells us if the player_id in question raised before the flop. Thus in the sample data we could have had all 0's or all 1's, or 2 1's, or 3 1's.
saw_flop -- boolean again. tells us if the player saw the flop or not. Again, all combinations of 0's and 1's are possible in theory.
MY QUESTION: I need SQL to query for all game_id's in which exactly 3 players saw the flop AND in which there was no pf_raise by ANY player. The DB is Access, but if you are familiar with a different setup that's fine: I'm not interested in the niceties of the syntax so much as the conceptual solution. But I would like to see SQL code, if possible.
Thanks in advance for any help,
gm
[tt]
game_id player_id number_of_players pf_raise saw_flop
21 2 4 0 1
21 8 4 0 1
21 372 4 0 0
21 76 4 1 1
[/tt]
game_id and player_id are globally unique.
number_of_players tells us how many players were dealt cards for that game_id.
pf_raise is boolean -- tells us if the player_id in question raised before the flop. Thus in the sample data we could have had all 0's or all 1's, or 2 1's, or 3 1's.
saw_flop -- boolean again. tells us if the player saw the flop or not. Again, all combinations of 0's and 1's are possible in theory.
MY QUESTION: I need SQL to query for all game_id's in which exactly 3 players saw the flop AND in which there was no pf_raise by ANY player. The DB is Access, but if you are familiar with a different setup that's fine: I'm not interested in the niceties of the syntax so much as the conceptual solution. But I would like to see SQL code, if possible.
Thanks in advance for any help,
gm