id_x_hand_group

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

id_x_hand_group

Postby Ganadai » Sat Mar 20, 2010 8:07 pm

Using a SQL query, is there an easier way to get the id_group number of a players hand on the flop or turn than by using something like this:

Code: Select all
SELECT (case when flg_f_highcard  then 9 else
       (case when flg_f_1pair     then 8 else
       (case when flg_f_2pair     then 7 else
       (case when flg_f_threeoak  then 6 else
       (case when flg_f_straight  then 5 else
       (case when flg_f_flush     then 4 else
       (case when flg_f_fullhouse then 3 else
       (case when flg_f_fouroak   then 2 else
       (case when flg_f_strflush  then 1 end) end) end) end) end) end) end) end) end)
FROM   holdem_hand_player_combinations
       LEFT OUTER JOIN player ON player.id_player = holdem_hand_player_combinations.id_player
WHERE  player.player_name IN ('PLAYER NAME')


Is it possible to add a column to holdem_hand_player_combinations and populate the column based on a formula so instead I could just use something like:

Code: Select all
SELECT id_f_hand_group
FROM   holdem_hand_player_combinations
       LEFT OUTER JOIN player ON player.id_player = holdem_hand_player_combinations.id_player
WHERE  player.player_name IN ('PLAYER NAME')
Ganadai
 
Posts: 12
Joined: Tue Nov 03, 2009 8:11 am

Re: id_x_hand_group

Postby kraada » Sun Mar 21, 2010 9:30 am

It wouldn't be something that you could add to the database at the moment, but I like the idea and I'll definitely make sure the suggestion gets to the developers.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


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

Who is online

Users browsing this forum: No registered users and 0 guests