Board hand

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

Board hand

Postby TROM » Sun Oct 10, 2010 10:12 am

How to write query if I want for examle hands where on board trips or 1 pair or another hand
Which table in posgres have board hand info ?
TROM
 
Posts: 57
Joined: Mon Jun 16, 2008 6:56 pm

Re: Board hand

Postby kraada » Sun Oct 10, 2010 12:47 pm

The details you want are in the holdem_hand_summary table - holdem_hand_summary.card_1, holdem_hand_summary.card_2 and holdem_hand_summary.card_3 are the flop cards, holdem_hand_summary.card_4 is the turn and holdem_hand_summary.card_5 is the river.

Details on what values these hold can be found in this post.

You'll have to compare them individually to one another - board texture details are not stored in the database.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Board hand

Postby TROM » Sun Oct 10, 2010 10:23 pm

ok

'card'
2c=1 / 2d=14 / 2h=27 / 2s=40
3c=2 / 3d=15 ...
4c=3
...
Ac=13 / Ad=26 / Ah=39 / As=52


but how in sql query i can recognize what hand I have on board ?

give me 2 example how to recognize that I have trips on flop and all cards have one suit on flop

1 Example
TRIPS
holdem_hand_summary.card_1=1;
holdem_hand_summary.card_2 =14;
holdem_hand_summary.card_3=27;

2 Example
one suit
holdem_hand_summary.card_1=1;
holdem_hand_summary.card_2 =5;
holdem_hand_summary.card_3=10;
TROM
 
Posts: 57
Joined: Mon Jun 16, 2008 6:56 pm

Re: Board hand

Postby kraada » Mon Oct 11, 2010 8:54 am

If holdem_hand_summary.card_1 % 13 = holdem_hand_summary.card_2 % 13 and holdem_hand_summary.card_2 % 13 = holdem_hand_summary.card_3 % 13 , you have trips.

For your club monotone board, holdem_hand_summary.card_1 <= 13 AND holdem_hand_summary.card_2 <= 13 AND holdem_hand_summary.card_3 <= 13.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Board hand

Postby TROM » Mon Oct 11, 2010 12:45 pm

for right understand

pair board will be

If
holdem_hand_summary.card_1 % 13 = holdem_hand_summary.card_2 % 13 AND
holdem_hand_summary.card_1 % 13 != holdem_hand_summary.card_3 % 13 OR

holdem_hand_summary.card_2 % 13 = holdem_hand_summary.card_3 % 13 AND
holdem_hand_summary.card_2 % 13 != holdem_hand_summary.card_1 % 13 OR

holdem_hand_summary.card_1 % 13 = holdem_hand_summary.card_3 % 13 AND
holdem_hand_summary.card_1 % 13 != holdem_hand_summary.card_2 % 13 OR

??
TROM
 
Posts: 57
Joined: Mon Jun 16, 2008 6:56 pm

Re: Board hand

Postby kraada » Mon Oct 11, 2010 2:37 pm

Yes, just you'll want to use ()s to offset everything properly and make sure the right things are ANDed or ORed together as you desire.
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