Common hands

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

Common hands

Postby pingvvino » Wed Aug 08, 2012 10:59 am

How could I check (SQL query) common hands for player A and player B?
pingvvino
 
Posts: 18
Joined: Fri Jul 20, 2012 12:41 pm

Re: Common hands

Postby kraada » Wed Aug 08, 2012 1:43 pm

If you want the hand histories you'd do something like:

SELECT hhh.history from holdem_hand_histories hhh where hhh.id_hand in (SELECT hhps.id_hand from holdem_hand_player_statistics hhps, player p where p.id_player = hhps.id_player and p.player_name = 'Player A') and hhs.id_hand in (SELECT hhps.id_hand from holdem_hand_player_statistics hhps, player p where p.id_player = hhps.id_player and p.player_name = 'Player B')

replace Player A and Player B as needed. This kind of query will take some time to complete though especially as your database gets large, so keep that in mind.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Common hands

Postby pingvvino » Wed Aug 08, 2012 3:17 pm

Thanks, but I don't want to have detail hand history, count of those hands is enough. Is it any faster method?
pingvvino
 
Posts: 18
Joined: Fri Jul 20, 2012 12:41 pm

Re: Common hands

Postby kraada » Wed Aug 08, 2012 5:34 pm

This might be slightly faster:

SELECT count(distinct hhps.id_hand) from holdem_hand_player_statistics hhps, player p, holdem_hand_player_statistics hhps2, player p2 where hhps.id_player = p.id_player and hhps.id_hand = hhps2.id_hand and hhps2.id_player = p2.id_player and p.player_name = 'Player A' and p2.player_name = 'Player B'

But it's still going to take time no matter how you slice it.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Common hands

Postby Jenniferhoops » Fri Aug 10, 2012 4:48 pm

This is really an interesting and fast method.
Jenniferhoops
 
Posts: 6
Joined: Wed Jul 25, 2012 3:26 pm
Location: Las Vegas


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

Who is online

Users browsing this forum: No registered users and 4 guests