Just wondering if anybody else has noticed a typo on page 32 of the database schema documentation? There seems to be two entries for an attribute "flg_showdown" in "tourney_holdem_player_statistics". The version I've got is from February 10, 2009.
On a related note, I'm writing a query to calculate the PFR for players with more than 50 hands played. I was wondering what might be the best way to do this? Here is what I have so far.
- Code: Select all
CREATE TABLE player_hand_count AS
SELECT id_player, sum (cnt_hands) AS total_hands
FROM holdem_table_session_summary
WHERE id_limit = 1
GROUP BY id_player;
CREATE TABLE threshold_players AS
SELECT id_player
FROM player_hand_count
WHERE total_hands > 50;
CREATE TABLE pfr AS
SELECT a.id_player, ((times_raised_pf / total_hands::float) * 100) AS pfr
FROM
(SELECT aa.id_player, count(id_hand) AS times_raised_pf
FROM holdem_hand_player_statistics aa
WHERE cnt_p_raise > 0
AND id_player IN (SELECT id_player from threshold_players)
GROUP BY aa.id_player) a
INNER JOIN player_hand_count b
ON a.id_player = b.id_player;
Cheers.
