I´m coding a tool that converts hands and does SQL queries to get following stats:
VPIP/PFR/AF/AFq/WTSD/W$@SD/3bet Hands
I tried learning by the logfile:
- Code: Select all
SELECT (player_real.player_name_search) as "str_player_name_search_real", (sum(if[holdem_hand_player_statistics.id_hand > 0, 1, 0])) as "cnt_hands", (player.player_name) as "str_player_name", (sum(if[holdem_hand_player_statistics.flg_vpip, 1, 0])) as "cnt_vpip", (sum(if[holdem_hand_player_statistics.cnt_p_raise > 0, 1, 0])) as "cnt_pfr", (sum(if[holdem_hand_player_statistics.flg_f_bet, 1, 0])) as "cnt_f_bet", (sum(holdem_hand_player_statistics.cnt_f_raise)) as "cnt_f_raise", (sum(if[holdem_hand_player_statistics.flg_t_bet, 1, 0])) as "cnt_t_bet", (sum(holdem_hand_player_statistics.cnt_t_raise)) as "cnt_t_raise", (sum(if[holdem_hand_player_statistics.flg_r_bet, 1, 0])) as "cnt_r_bet", (sum(holdem_hand_player_statistics.cnt_r_raise)) as "cnt_r_raise", (sum(holdem_hand_player_statistics.cnt_f_call)) as "cnt_f_call", (sum(holdem_hand_player_statistics.cnt_t_call)) as "cnt_t_call", (sum(holdem_hand_player_statistics.cnt_r_call)) as "cnt_r_call", (sum(if[holdem_hand_player_statistics.flg_f_fold, 1, 0])) as "cnt_f_fold", (sum(if[holdem_hand_player_statistics.flg_t_fold, 1, 0])) as "cnt_t_fold", (sum(if[holdem_hand_player_statistics.flg_r_fold, 1, 0])) as "cnt_r_fold", (sum(if[holdem_hand_player_statistics.flg_showdown, 1, 0])) as "cnt_wtsd", (sum(if[holdem_hand_player_statistics.flg_f_saw, 1, 0])) as "cnt_f_saw", (sum(if[holdem_hand_player_statistics.flg_p_3bet, 1, 0])) as "cnt_p_3bet", (sum(if[holdem_hand_player_statistics.flg_p_3bet_opp, 1, 0])) as "cnt_p_3bet_opp" FROM holdem_hand_summary, holdem_hand_player_statistics , player, player player_real WHERE (player.id_player = holdem_hand_player_statistics.id_player) AND (player_real.id_player = holdem_hand_player_statistics.id_player_real) AND (holdem_hand_summary.id_hand = holdem_hand_player_statistics.id_hand) AND ((holdem_hand_summary.cnt_players >= 4 AND holdem_hand_summary.cnt_players <= 10)AND (holdem_hand_player_statistics.date_played < '2009/11/05 14:32:19')AND ((holdem_hand_player_statistics.id_player in (SELECT if[p.id_player_alias <> 0, p.id_player_alias, p.id_player] FROM player p WHERE ((p.id_site=300 AND p.player_name_search='mary wing') OR (p.id_site=300 AND p.player_name_search='_soya76_') OR (p.id_site=300 AND p.player_name_search='iron_man_404') OR (p.id_site=300 AND p.player_name_search='obv r1gg3d') OR (p.id_site=300 AND p.player_name_search='777amanda777')))))) GROUP BY (player_real.player_name_search), (player.player_name) HAVING (((sum(if[holdem_hand_player_statistics.id_hand > 0, 1, 0])) >= 1))
2009/11/06 10:49:49.047: [00002B58][Query] Playback for Full Tilt Hand #15810320231 - $0.10 NL (6 max) - Texas Holdem [TA0]: Query execution time: 7.92433859 ms :
When I use parts of it in pgadmin:
- Code: Select all
SELECT (sum(if[holdem_hand_player_statistics.flg_p_3bet_opp, 1, 0])) as "cnt_p_3bet_opp" FROM holdem_hand_player_statistics WHERE id_player = 3054
fails at pgadmin:
ERROR: syntax error at or near ","
SQL Status:42601
Zeichen:60
So I guess thats PT3 code, so I cant do it this way.
Can you show me one little Query that returns a stat?
f.e. "Give me the PFR of player "Homofürst"" (so <a player id search> included, I only succeed by knowing the player_id)
