fold BB to SB minraise

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

fold BB to SB minraise

Postby jludman » Fri Sep 11, 2009 12:47 pm

I want to break down how often BB folds to various size SB steals. So, I think I got minraise working:

I have:
(cnt_p_BB_fold_to_SB_minraise / cnt_p_BB_fold_to_SB_opp_minraise) * 100

where cnt_p_BB_fold_to_SB_minraise is:

sum(if[substring(lookup_actions_p.action from 1 for 1)='F' AND
holdem_hand_player_statistics.position = 8 AND
holdem_hand_player_detail.amt_p_raise_facing <= (2 * holdem_limit.amt_bb) AND holdem_hand_player_detail.val_p_raise_aggressor_pos = 9 AND holdem_hand_player_statistics.flg_blind_def_opp,1,0])

and cnt_p_BB_fold_to_SB_opp_minraise is:

sum(if[holdem_hand_player_statistics.position = 8 AND holdem_hand_player_detail.val_p_raise_aggressor_pos = 9 AND holdem_hand_player_detail.amt_p_raise_facing <= (2 * holdem_limit.amt_bb) AND
holdem_hand_player_statistics.flg_blind_def_opp,1,0])

It seems like it is working, when I had it report attempts/success in the HUD. However, when I tried to add additional ones like fold to bigger than a minraise, PT tells me that my SQL is invalid when I try to save it. In fact, if I just try to save the existing columns again, it tells me that what's already in there is invalid.

Also, is there a list/description of the data structures you can use for these columns? I only found *.amt_p_raise_facing by searching the forums for minraise, and finding someone elses code that included that. So, I'm not sure if the BB is "facing" 1BB when it's minraised or 2...
jludman
 
Posts: 24
Joined: Mon Jun 09, 2008 4:46 pm

Re: fold BB to SB minraise

Postby kraada » Fri Sep 11, 2009 1:18 pm

Your data looks okay, sometimes the verification system can get really picky about whitespace which might be happening for you I'm not sure. If you paste what won't validate I'll be glad to take a look at it for you.

For a complete list of database, fields see the Database Schema.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: fold BB to SB minraise

Postby jludman » Fri Sep 11, 2009 3:38 pm

So the validation parser is different from the one that actually interprets the code? Then it makes some sense that it is working, but won't validate.

-=-=-=

sum(if[substring(lookup_actions_p.action from 1 for 1)='F' AND
holdem_hand_player_statistics.position = 8 AND
holdem_hand_player_detail.amt_p_raise_facing <= (2 * holdem_limit.amt_bb) AND holdem_hand_player_detail.val_p_raise_aggressor_pos = 9 AND holdem_hand_player_statistics.flg_blind_def_opp,1,0])

-=-=-=

sum(if[holdem_hand_player_statistics.position = 8 AND holdem_hand_player_detail.val_p_raise_aggressor_pos = 9 AND holdem_hand_player_detail.amt_p_raise_facing <= (2 * holdem_limit.amt_bb) AND
holdem_hand_player_statistics.flg_blind_def_opp,1,0])

-=-=-=

both don't validate. Does cut/paste really preserve white space exactly?

Wait, if I click "Dup" on any column, then validate it says it is not valid SQL. I guess my problem isn't with this specific query. Wow, now if I try to do housekeeping, I get 4 errors saying "invalid postgreSQL connection object".
jludman
 
Posts: 24
Joined: Mon Jun 09, 2008 4:46 pm

Re: fold BB to SB minraise

Postby jludman » Fri Sep 11, 2009 3:49 pm

never mind. I think this was related to me still running as administrator sometimes. Don't need to do that anymore.
jludman
 
Posts: 24
Joined: Mon Jun 09, 2008 4:46 pm

Re: fold BB to SB minraise

Postby kraada » Fri Sep 11, 2009 4:11 pm

. . . so you got everything sorted?
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: fold BB to SB minraise

Postby jludman » Fri Sep 11, 2009 4:26 pm

Seems okay. I think I crashed the SQL server, because everything was hosed, until I rebooted. Seems okay now.
jludman
 
Posts: 24
Joined: Mon Jun 09, 2008 4:46 pm

Re: fold BB to SB minraise

Postby marvin » Tue Sep 15, 2009 4:46 am

im tryng to learn reading about job of others and looking DB schema, but is not clear to me...
1) what happens when there are 10 players on table? position BB is 9? and button?
2) how work the statement: sum(if[substring(lookup_actions_p.action from 1 for 1)='F' ? i think it verify if everyone has folded to SB, but the sintax for the expression "from 1 for 1" how works? if i want verify that players 4-5-6-7 has folded how can i do?
TY
marvin
 
Posts: 327
Joined: Tue Jul 08, 2008 10:17 am

Re: fold BB to SB minraise

Postby marvin » Tue Sep 15, 2009 5:09 am

Sorrry, i meant when the table has 9 or less player, so if the button is "0", SB is 8 (or less) and Bb is 7 (or less) right? but the stats how works now?
marvin
 
Posts: 327
Joined: Tue Jul 08, 2008 10:17 am

Re: fold BB to SB minraise

Postby kraada » Tue Sep 15, 2009 8:37 am

The BB is always 8 and the SB is always 9 regardless of how many players are at the table. At a 10 person table there is a position 7, but at 9 person that doesn't exist and it goes 0, 1, 2 ... 6, 8, 9 (without 7). At 8 person there is no 6, etc. 8 and 9 are kept static to make it easier to track who is in the blinds.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: fold BB to SB minraise

Postby WhiteRider » Tue Sep 15, 2009 10:00 am

The substring functionality is explained in the Custom Statistics and Reports FAQ although you'll probably find it easier to check strings like this instead:
lookup_actions_p.action = 'F'
This is also explained in the FAQ.

You can't check for specific opponents' actions, but you can check if everyone has folded because the player will have an opportunity to open the pot, which is stored in the database field:
holdem_hand_player_statistics.flg_p_open_opp
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Next

Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 0 guests