What if the Select statement is a saved Query. That is, it does not work if I save
SELECT id
FROM my_table
WHERE x = 1;
as MyQuery
and then try to do:
SELECT *
FROM my_table
WHERE id IN (MyQuery);
I'm familiar with
SELECT *
FROM my_table
WHERE id IN (2,4,8)
But how can I do something like this:
SELECT *
FROM my_table
WHERE id IN (
SELECT *
FROM my_table
WHERE x = 1
);
Please IGNORE that the subquery in the above example is totally unneeded. This is a purely snyntactical...
Yes. Thank you.
Also, if I am interested ONLY in games in which I was one of the players, how could I do this?
Each row also has a "player_id" field -- and for each group of "game_id" every "player_id" is unique. The problem is that I cannot simply add
"WHERE player_id = 12"
because...
The "game_players" table contains poker data. Each "game_id" is repeated for as many players happened to be in that game, or hand.
If a player saw the flop, then the field "saw_flop_n" = 1; if not, it equals 0. I'm trying to get all game_id in which exactly two players saw the flop:
SELECT...
Golom,
Thanks again. I have now adapted your code to the actual table, which has a couple idiosyncrasies, and I am getting a strange result.
SELECT Avg(BS.total_won - BS.total_bet) AS [Avg Won], BS.hole_cards AS [Hole Cards], count(*) AS [Sample Size]
FROM [SELECT *
FROM game_players AS GP...
Golom,
Thank you very much. I hope you can help with another quick one....
Two other columns in that table are "total_won" and "hole_cards". The following query will select display the hole cards and the amount won for all steal attempts made on the button:
SELECT GP.total_won, GP.hole_cards...
My database contains poker data with the following relevant colums (I've included sample data):
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.