vpip for each distinct position and number of players

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

vpip for each distinct position and number of players

Postby will123195 » Fri Jul 04, 2008 1:33 am

how can i query my vpip for each distinct position and number of players?
will123195
 
Posts: 3
Joined: Sun Jun 29, 2008 12:37 am

Re: vpip for each distinct position and number of players

Postby WhiteRider » Fri Jul 04, 2008 4:26 am

The simplest way would be to use filters to isolate each combination of position and number of players, but this is obviously quite long winded and won't show all the results on the same screen.
If you want to see them all together, you'll need to create a Custom Stat for each combination - once you create the first one you can duplicated and edit it to create the rest. Then you can create Custom Report to show your new stats.
Documentation.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: vpip for each distinct position and number of players

Postby will123195 » Sun Jul 06, 2008 2:59 am

i figured out the sql for this:

Code: Select all
SELECT numerator.position,
       count(*)::float /
   (SELECT count(*)
    FROM tourney_holdem_hand_player_statistics denominator
    WHERE denominator.id_player = 4
    and numerator.position = denominator.position
    GROUP BY denominator."position")::float
   as vpip
FROM tourney_holdem_hand_player_statistics numerator
WHERE numerator.id_player = 4
and flg_vpip is true
GROUP BY numerator."position"
order by position
will123195
 
Posts: 3
Joined: Sun Jun 29, 2008 12:37 am

Re: vpip for each distinct position and number of players

Postby will123195 » Sun Jul 06, 2008 3:28 am

i think this is close to what i was looking for:

Code: Select all
SELECT numerator.position, summary.cnt_players_f,
       count(*)::float /

   (SELECT count(*)
    FROM tourney_holdem_hand_player_statistics denominator
    WHERE denominator.id_player = 4
    and numerator.position = denominator.position
    GROUP BY denominator."position")::float
   as vpip
   
FROM tourney_holdem_hand_player_statistics numerator
left join tourney_holdem_hand_summary summary on summary.id_hand = numerator.id_hand
WHERE numerator.id_player = 4
and flg_vpip is true
GROUP BY numerator."position", summary.cnt_players_f
order by position, cnt_players_f
will123195
 
Posts: 3
Joined: Sun Jun 29, 2008 12:37 am


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

Who is online

Users browsing this forum: No registered users and 0 guests