What is improper about this SQL?

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

What is improper about this SQL?

Postby slowdeer » Wed Jan 07, 2009 5:37 am

Code: Select all
sum(if[((holdem_hand_summary.cnt_players = 4 and holdem_hand_player_statistics.position = 1) or
(holdem_hand_summary.cnt_players = 5 and holdem_hand_player_statistics.position = 2) or
(holdem_hand_summary.cnt_players = 6 and holdem_hand_player_statistics.position = 3) or
(holdem_hand_summary.cnt_players = 7 and holdem_hand_player_statistics.position = 4) or
(holdem_hand_summary.cnt_players = 8 and (holdem_hand_player_statistics.position = 4 or holdem_hand_player_statistics.position = 5)) or
(holdem_hand_summary.cnt_players = 9 and (holdem_hand_player_statistics.position = 5 or holdem_hand_player_statistics.position = 6)) or
(holdem_hand_summary.cnt_players = 10 and (holdem_hand_player_statistics.position = 6 or holdem_hand_player_statistics.position = 7)))
, 1, 0]


I can't figure it out, PT3 won't let me make this column. I just want to make a "cnt_hands_ep" column.
slowdeer
 
Posts: 7
Joined: Thu May 15, 2008 10:25 pm

Re: What is improper about this SQL?

Postby WhiteRider » Wed Jan 07, 2009 10:08 am

You need to close the bracket for the SUM right at the end, after the ] for the IF.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK


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

Who is online

Users browsing this forum: No registered users and 5 guests