sql query problem

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

sql query problem

Postby daniguru » Sat Apr 12, 2014 9:02 am

hi kraada and Co

Would be very nice if someone could help me out.

did i miss something in the FROM and WHERE part? maybe in FROM lookup_hole_cards_holdem
and in WHERE (lookup_actions_r.id_action=holdem_hand_player_detail.id_action_r) \
AND s.id_hand = holdem_hand_player_detail.id_hand ??
I tried both but get only value-1 as result any idea?
many thanks

"SELECT CASE WHEN B = 0 THEN -1 ELSE 1.0*A/B END AS RESULT \
FROM (SELECT SUM(CASE WHEN (pc.flg_r_highcard OR \
(pc.flg_r_1pair AND pc.id_r_hand_strength < 3) OR \
(pc.flg_r_1pair AND pc.id_r_hand_strength = 4) OR \
(pc.flg_r_1pair AND pc.id_r_hand_strength = 5) OR \
(pc.flg_r_2pair AND pc.id_r_hand_strength < 3) OR \
(pc.flg_r_2pair AND pc.id_r_hand_strength = 4) OR \
(pc.flg_r_2pair AND pc.id_r_hand_strength = 5) OR \
(pc.flg_r_threeoak AND pc.id_r_hand_strength = 0) OR \
(pc.flg_r_straight AND pc.id_r_hand_strength = 0) OR \
(pc.flg_r_flush AND pc.id_r_hand_strength = 0) OR \
(pc.flg_r_fullhouse AND pc.id_r_hand_strength = 0) OR \
(pc.flg_r_fouroak AND pc.id_r_hand_strength = 0) OR \
(pc.flg_r_strflush AND pc.id_r_hand_strength = 0)) AND \
s.flg_r_bet AND NOT \
s.flg_showdown AND \
s.flg_won_hand then 1 else 0 end) AS A, \
sum(case when s.flg_r_bet AND s.id_holecard>0 then 1 else 0 end) AS B \
FROM holdem_hand_player_statistics s, holdem_hand_player_combinations pc, player as p \
WHERE s.id_hand = pc.id_hand AND s.id_player = p.id_player \
AND holdem_hand_player_statistics.id_player = P.id_player \
AND P.player_name like '%SCREENNAME%'AND \
P.id_site=%SITEID%) FOO",
daniguru
 
Posts: 69
Joined: Mon Aug 11, 2008 10:20 am

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

Who is online

Users browsing this forum: No registered users and 10 guests

cron
highfalutin