by _dave_ » Tue Jan 29, 2008 9:38 pm
Try this:
[codeulg]
--Players - Hands - Money - VPIP - PFR - 3Bet - Foldto 3bet - Call 3bet - Raise 3bet - Foldto 3bet when PFR - Call 3bet when PFR - Raise 3bet when PFR- WTSD% - Cbet % - Cbet/Fold when CR - Cbet/Call when CR - Cbet/Raise when CR - Cbet after 3b Pre - FoldtoflopCbet
SELECT
p.player_name,
COUNT(hhps.id_player) AS hands,
SUM (amt_won) AS monies,
AVG (CASE WHEN flg_vpip THEN 1 ELSE 0 END)*100 AS vpip,
AVG (CASE WHEN cnt_p_raise >= 1 THEN 1 ELSE 0 END)*100 AS pfr,
AVG (CASE WHEN flg_p_3bet THEN 1 WHEN flg_p_3bet_opp THEN 0 END)*100 AS threebet,
AVG (CASE WHEN enum_p_3bet_action = 'F' THEN 1 WHEN flg_p_3bet_def_opp THEN 0 END)*100 AS fold_to_threebet,
AVG (CASE WHEN enum_p_3bet_action = 'C' THEN 1 WHEN flg_p_3bet_def_opp THEN 0 END)*100 AS call_to_threebet,
AVG (CASE WHEN enum_p_3bet_action = 'R' THEN 1 WHEN flg_p_3bet_def_opp THEN 0 END)*100 AS raise_to_threebet,
AVG (CASE WHEN enum_p_3bet_action = 'F' AND flg_p_first_raise THEN 1 WHEN flg_p_3bet_def_opp AND flg_p_first_raise THEN 0 END)*100 AS fold_facing_threebet_as_pfr,
AVG (CASE WHEN enum_p_3bet_action = 'C' AND flg_p_first_raise THEN 1 WHEN flg_p_3bet_def_opp AND flg_p_first_raise THEN 0 END)*100 AS call_facing_threebet_as_pfr,
AVG (CASE WHEN enum_p_3bet_action = 'R' AND flg_p_first_raise THEN 1 WHEN flg_p_3bet_def_opp AND flg_p_first_raise THEN 0 END)*100 AS raise_facing_threebet_as_pfr,
AVG (CASE WHEN flg_showdown AND flg_vpip THEN 1 WHEN flg_vpip THEN 0 END)*100 AS wtsd,
AVG (CASE WHEN flg_f_cbet THEN 1 WHEN flg_f_cbet_opp THEN 0 END)*100 AS cbet,
AVG (CASE WHEN flg_f_cbet AND flg_f_3bet_opp AND flg_f_fold AND flg_f_4bet_def_opp = 'f' THEN 1 WHEN flg_f_cbet AND flg_f_3bet_opp AND flg_f_4bet_def_opp = 'f' THEN 0 END)*100 AS fold_when_cbet_raise,
AVG (CASE WHEN flg_f_cbet AND flg_f_3bet_opp AND cnt_f_call >=1 AND flg_f_4bet_def_opp = 'f' THEN 1 WHEN flg_f_cbet AND flg_f_3bet_opp AND flg_f_4bet_def_opp = 'f' THEN 0 END)*100 AS call_when_cbet_raise,
AVG (CASE WHEN flg_f_cbet AND flg_f_3bet_opp AND cnt_f_raise >=1 AND flg_f_4bet_def_opp = 'f' THEN 1 WHEN flg_f_cbet AND flg_f_3bet_opp AND flg_f_4bet_def_opp = 'f' THEN 0 END)*100 AS raise_when_cbet_raise,
AVG (CASE WHEN flg_f_cbet AND flg_p_3bet THEN 1 WHEN flg_f_cbet_opp AND flg_p_3bet THEN 0 END)*100 AS cbet_after_pf_3bet
FROM player p, holdem_hand_player_statistics hhps
WHERE p.id_player = hhps.id_player
GROUP BY p.player_name
HAVING COUNT(hhps.id_player) > 100
ORDER BY COUNT(hhps.id_player) DESC;
[/codeulg]
Note I have added a column for monies (surely you want to know if the player is winning or losing :) Also I have done both forms of 3bet stats - the std. ones first, the (ones I argued for) second, where one is 3bet as the open-raiser (thus they sum to 100% of actions). Same goes for the raised CBET %, I ignored what happens after (4 / 5 bets) - so these are a 100% Sum also.
I added Call 3bet too.
I'm not sure how WTSD should work... I did WTSD when VPIP - maybe WTSD WSF & VPIP would be more useful?
I has only a small database so I set minimum hands to 100 - you will want to change this.
You will need the latest PT3 version for the cbet stats to be correct.
dave.