PDA

View Full Version : Please help with custom report!



anter
08-02-2009, 12:24 PM
I want to know how many hands I have played having a stack > 200 BB. I know I can get that using a HM report, but I'd want to understand how to create a SQL query for it.

This is my best shot. Unfortunately it doesn't work. I would be really happy and grateful for help with this.


SELECT stacksize FROM playerhandscashmisc_hero
JOIN playerhandscashkeycolumns_hero
ON playerhandscashkeycolumns_hero.playerhand_id = playerhandscashmisc_hero.playerhand_id
JOIN players
ON players.player_id = playerhandscashkeycolumns_hero.player_id
WHERE stacksize > 200
AND playername = 'name'


Thank you!

anter
08-02-2009, 01:33 PM
I think this might be a bit better, but still I need help from you with the last steps.



SELECT stacksize FROM playerhandscashmisc_hero
JOIN playerhandscashkeycolumns_hero
ON playerhandscashkeycolumns_hero.playerhand_id = playerhandscashmisc_hero.playerhand_id
JOIN pokerhands
ON pokerhands.pokerhand_id = playerhandscashkeycolumns_hero.pokerhand_id
JOIN gametypes
ON gametypes.gametype_id = pokerhands.gametype_id
JOIN players
ON players.player_id = playerhandscashkeycolumns_hero.player_id
WHERE stacksize > 200 / bigblind
AND playername = 'name'

fozzy71
08-02-2009, 04:24 PM
I can forward this to the developer to look at, but it may not be right away.

anter
08-03-2009, 05:22 AM
Please do that. I appreciate it fozzy!

Rvg72
08-03-2009, 06:50 PM
To get the total number just change

Select StackSize

to

Select Count(*)

anter
08-04-2009, 10:39 AM
Thanks for trying to help RVG, but there seems to be a bigger problem with the query.

When counting the rows I do get a "count bigint" back. But it is a very incorrect number!

I tried entering a player name and >200BB in HM and I could see that he had played with a 200BB+ stack 379 hands, but when I entered the same player name and stack size into my query I got 8649 with count, an impossibly large number in this case.

There is some bigger problem with my query. But I'm not skilled enough in the HM database to figure it out.

So I still need help. It will really make my day when you figure out how to solve this.

anter
08-04-2009, 01:02 PM
Oh, I see 8649 is the total number of hands played by that alias. Changing the stacksize to 200000 returns a smaller but still incorrect number.