Page 1 of 1

a question about substring

PostPosted: Thu Jun 21, 2012 9:06 am
by husngforfood
This is the definition of a built in column named: cnt_f_donk_def_opp_action_fold

sum(if[lookup_actions_p.action LIKE '%R' AND tourney_hand_player_statistics.amt_f_bet_facing > 0 AND NOT (tourney_hand_player_statistics.flg_f_open_opp) AND substring(lookup_actions_f.action from 1 for 1) = 'F', 1, 0])

Why is substring used here? Wouldn't it mean the same if we used: lookup_actions_f.action LIKE 'F'?

Re: a question about substring

PostPosted: Thu Jun 21, 2012 10:05 am
by kraada
Well, given that it's a substring for a fold it won't make a difference - since fold is always the last action. But if it were substring(from 1 for 1) = 'B' then it would be like 'B%' - all we're testing is that the first letter is B, anything else could come after.

highfalutin