Hand Range Pop-up

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

Hand Range Pop-up

Postby devolveNZ » Thu Dec 16, 2010 8:54 am

I am wanting to create a Hand Range Pop-up similar to Kraada's in this post viewtopic.php?f=45&t=11188

However instead of creating 169 columns I would like to use groups of hands, for example:
creating a Hand Range Pop-up for hands that a player limps with I may use the following hand grouping:
big pairs AA,KK
large pairs QQ,JJ
medium pairs TT-77
small pairs 66-22
big suitied connectors KQs-98s
... etc ... down to ...
Junk Hands (all others not in the above)

Creating the column for when a player limps with big pairs (Hand id 1 and 26)seems easy;
cnt_limp_show_bigpair:
sum( if[holdem_hand_player_statistics.flg_p_limp AND (holdem_hand_player_statistics.id_holecard = 1 OR
holdem_hand_player_statistics.id_holecard = 26), 1, 0])

For the small pairs column, I will need to create 5 statements joined within the OR part, my question is; this will become very messy when I go to create I column for the junk hands, is there an easier way to do the sql than a huge list of OR'S joined together?

Thanks Greg
devolveNZ
 
Posts: 31
Joined: Mon Sep 08, 2008 9:27 pm

Re: Hand Range Pop-up

Postby kraada » Thu Dec 16, 2010 9:53 am

Unfortunately there isn't a neater way to do that, the only small addition that I can mention is the use of BETWEEN.

Let's say for the time being that you define "junk" as everything 86o and less (so 85s, 85o, 84s, 84o, 83s, 83o, 82s, 82o). Instead of (holdem_hand_player_statistics.id_holecard = 125 or holdem_hand_player_statistics.id_holecard = 124 OR .... you can do: holdem_hand_player_statistics.id_holecard BETWEEN 125 and 133

BETWEEN 125 and 133 = any value in: 125, 126, 127, 128, 129, 130, 131, 132, 133.

This may make things a bit easier for you to handle. You also could potentially use not as well depending on the exact setups you want - if you wanted to make a column for all non-pairs for example you could use BETWEEN 1 and 169 and NOT( id_holecard = 1 OR ...) - but if you already have the pairs list built, that would make life easier as you could then copy and paste.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


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

Who is online

Users browsing this forum: No registered users and 0 guests