by Santa25 » Sat Mar 22, 2025 4:45 pm
I'm trying to create a new stat. Situational button fold - sb openraise - bb call - flop sb bet - bb cal - turn - sb check - bb bet sb fold - I want to see how often sb gives up on a bet on a turn
stat (me_cnt_sb_fold_to_turn_probe * 100.0) / NULLIF(me_cnt_sb_fold_to_turn_probe_opp, 0)
me_cnt_sb_fold_to_turn_probe * 100.0
SUM(
CASE
WHEN tourney_hand_player_statistics.position = 8
AND tourney_hand_summary.str_aggressors_p LIKE '89%'
AND tourney_hand_summary.str_actors_p LIKE '89%'
AND tourney_hand_player_statistics.flg_p_cbet_f
AND tourney_hand_player_statistics.flg_p_call_f
AND tourney_hand_player_statistics.flg_p_chk_t
AND tourney_hand_player_statistics.flg_p_fold_t
THEN 1
ELSE 0
END
)
me_cnt_sb_fold_to_turn_probe_opp
SUM(
CASE
WHEN tourney_hand_player_statistics.position = 8
AND tourney_hand_summary.str_aggressors_p LIKE '89%'
AND tourney_hand_summary.str_actors_p LIKE '89%'
AND tourney_hand_player_statistics.flg_p_cbet_f
AND tourney_hand_player_statistics.flg_p_call_f
AND tourney_hand_player_statistics.flg_p_chk_t
AND (
tourney_hand_player_statistics.flg_p_fold_t
OR tourney_hand_player_statistics.flg_p_call_t
OR tourney_hand_player_statistics.flg_p_raise_t
)
THEN 1
ELSE 0
END
)
I'm checking validate columns different options, there's an error everywhere= The statement is not valid SQL
I ran it through three neural networks - but all attempts were = The statement is not valid SQL
sum(if[
tourney_hand_player_statistics.position = 8
and tourney_hand_summary.str_aggressors_p LIKE '89%'
and tourney_hand_summary.str_actors_p LIKE '89%'
and tourney_hand_player_statistics.flg_p_cbet_f
and tourney_hand_player_statistics.flg_p_call_f
and tourney_hand_player_statistics.flg_p_chk_t
and tourney_hand_player_statistics.flg_p_fold_t,
1, 0])
sum(if[
tourney_hand_player_statistics.position = 8
and tourney_hand_summary.str_aggressors_p LIKE '89%'
and tourney_hand_summary.str_actors_p LIKE '89%'
and tourney_hand_player_statistics.flg_p_cbet_f
and tourney_hand_player_statistics.flg_p_call_f
and tourney_hand_player_statistics.flg_p_chk_t
and (tourney_hand_player_statistics.flg_p_fold_t
or tourney_hand_player_statistics.flg_p_call_t
or tourney_hand_player_statistics.flg_p_raise_t),
1, 0])
sum(if[
-- Preflop
tourney_hand_summary.str_aggressors_p LIKE '89%'
AND tourney_hand_summary.str_actors_p LIKE '8%'
AND tourney_hand_player_statistics.flg_p_open_opp
AND tourney_hand_player_statistics.flg_p_raise = 1
-- Flop
AND tourney_hand_player_statistics.flg_f_bet = 1
AND lookup_actions_f.action LIKE '%C'
-- Turn
AND tourney_hand_player_statistics.flg_t_check = 1
AND lookup_actions_t.action LIKE 'B%'
, 1, 0])
SELECT
lookup_actions_t.action,
tourney_hand_player_statistics.flg_t_fold
FROM tourney_hand_summary
JOIN tourney_hand_player_statistics
ON tourney_hand_summary.id_hand = tourney_hand_player_statistics.id_hand
WHERE tourney_hand_summary.str_aggressors_p LIKE '89%'
LIMIT 10;
sum(if[tourney_hand_summary.str_aggressors_p LIKE '89%' AND tourney_hand_summary.str_actors_p LIKE '8%' AND tourney_hand_player_statistics.flg_p_open_opp AND tourney_hand_player_statistics.flg_p_raise = 1 AND tourney_hand_player_statistics.flg_f_bet = 1 AND lookup_actions_f.action LIKE '%C' AND tourney_hand_player_statistics.flg_t_check = 1 AND lookup_actions_t.action LIKE 'B%' AND tourney_hand_player_statistics.flg_t_fold = 1, 1, 0])
sum(if[tourney_hand_summary.str_aggressors_p LIKE '89%' AND tourney_hand_summary.str_actors_p LIKE '8%' AND tourney_hand_player_statistics.flg_p_open_opp AND tourney_hand_player_statistics.flg_p_raise = 1 AND tourney_hand_player_statistics.flg_f_bet = 1 AND lookup_actions_f.action LIKE '%C' AND tourney_hand_player_statistics.flg_t_check = 1 AND lookup_actions_t.action LIKE 'B%', 1, 0])
sum(if[
tourney_hand_summary.str_aggressors_p LIKE '89%'
AND tourney_hand_summary.str_actors_p LIKE '8%'
AND tourney_hand_player_statistics.flg_p_open_opp
AND tourney_hand_player_statistics.flg_p_raise = 1
AND tourney_hand_player_statistics.flg_f_bet = 1
AND lookup_actions_f.action LIKE '%C'
AND tourney_hand_player_statistics.flg_t_check = 1
AND lookup_actions_t.action LIKE 'B%'
AND tourney_hand_player_statistics.flg_t_fold = 1,
1,
0
])
sum(if[
tourney_hand_summary.str_aggressors_p LIKE '89%'
AND tourney_hand_summary.str_actors_p LIKE '8%'
AND tourney_hand_player_statistics.flg_p_open_opp
AND tourney_hand_player_statistics.flg_p_raise = 1
AND tourney_hand_player_statistics.flg_f_bet = 1
AND lookup_actions_f.action LIKE '%C'
AND tourney_hand_player_statistics.flg_t_check = 1
AND lookup_actions_t.action LIKE 'B%',
1,
0
])
me_cnt_sb_fold_turn =
SUM(
IF[
tourney_hand_summary.str_aggressors_p = '9'
AND tourney_hand_player_statistics.position = 9
AND tourney_hand_player_statistics.enum_p_2bet_action = 'R'
AND tourney_hand_player_statistics.enum_p_3bet_action = 'C'
AND tourney_hand_player_statistics.enum_f_bet_action = 'B'
AND tourney_hand_player_statistics.enum_f_call_action = 'C'
AND tourney_hand_player_statistics.enum_t_check_action = 'K'
AND tourney_hand_player_statistics.enum_t_bet_action = 'B'
AND tourney_hand_player_statistics.enum_t_fold_action = 'F',
1, 0
]
)
me_cnt_sb_fold_turn_opp =
SUM(
IF[
tourney_hand_summary.str_aggressors_p = '9'
AND tourney_hand_player_statistics.position = 9
AND tourney_hand_player_statistics.enum_p_2bet_action = 'R'
AND tourney_hand_player_statistics.enum_p_3bet_action = 'C'
AND tourney_hand_player_statistics.enum_f_bet_action = 'B'
AND tourney_hand_player_statistics.enum_f_call_action = 'C'
AND tourney_hand_player_statistics.enum_t_check_action = 'K'
AND tourney_hand_player_statistics.enum_t_bet_action = 'B',
1, 0
]
)
me_cnt_sb_fold_turn =
SUM(
IF(
tourney_hand_summary.str_aggressors_p = '9'
AND tourney_hand_player_statistics.position = 9
AND tourney_hand_player_statistics.enum_p_2bet_action = 'R'
AND tourney_hand_player_statistics.enum_p_3bet_action = 'C'
AND tourney_hand_player_statistics.enum_f_bet_action = 'B'
AND tourney_hand_player_statistics.enum_f_call_action = 'C'
AND tourney_hand_player_statistics.enum_t_check_action = 'K'
AND tourney_hand_player_statistics.enum_t_bet_action = 'B'
AND tourney_hand_player_statistics.enum_t_fold_action = 'F',
1, 0
)
)
me_cnt_sb_fold_turn_opp =
SUM(
IF(
tourney_hand_summary.str_aggressors_p = '9'
AND tourney_hand_player_statistics.position = 9
AND tourney_hand_player_statistics.enum_p_2bet_action = 'R'
AND tourney_hand_player_statistics.enum_p_3bet_action = 'C'
AND tourney_hand_player_statistics.enum_f_bet_action = 'B'
AND tourney_hand_player_statistics.enum_f_call_action = 'C'
AND tourney_hand_player_statistics.enum_t_check_action = 'K'
AND tourney_hand_player_statistics.enum_t_bet_action = 'B',
1, 0
)
)
all situations =The statement is not valid SQL
I wrote this so that you understand that I have tried many times but without success
Please help me
I found a very short guide - maybe there is a more detailed one?