how to get bb/100 ???

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

how to get bb/100 ???

Postby MaxWeiss » Tue Apr 01, 2008 8:08 pm

For the life of me I cannot query to get bb/100 from PT3. I keep getting an error the the column amt_bb_won doesn't exist even though I can see it right there in the custom stats tab!
MaxWeiss
 
Posts: 43
Joined: Sun Feb 10, 2008 10:40 pm

Re: how to get bb/100 ???

Postby Josh » Tue Apr 01, 2008 8:15 pm

If you are using SQL, you need to use the value of the amt_bb_won column in the custom stats configuration, not the name of the column itself.
Josh
Site Admin
 
Posts: 6222
Joined: Sat Dec 08, 2007 6:03 pm

Re: how to get bb/100 ???

Postby MaxWeiss » Thu Apr 03, 2008 3:38 am

I still cannot seem to get this working. In the PT3 database, I have 2545 hands, have won $354.10 and it says on the main PT3 screen that I make about 13.91 BB/100 in this (small) sample. But I get a weird number, 34.17, when I use this code, which is what is listed in the columns tab for amt_bb_won and then as you see divided by (number of hands / 100). For the life of me, I don't know what the problem is!

[codezzp]SELECT round(sum(hhps.amt_won/(hhl.amt_bb*hhl.val_nlpl_mult))/(COUNT(hhps.id_player)/100),2) AS bets_per_hundo FROM player p, holdem_hand_player_statistics hhps, holdem_limit hhl WHERE p.id_player = hhps.id_player AND p.player_name = 'MY_NAME_HERE';[/codezzp]

I have also tried many different variations and cannot get it to work! Can you possibly find out where the problem lies??? Thank you so much!!!!!
MaxWeiss
 
Posts: 43
Joined: Sun Feb 10, 2008 10:40 pm

Re: how to get bb/100 ???

Postby Josh » Thu Apr 03, 2008 8:37 am

You aren't joining the holdem_limit table anywhere. You need to add "AND hhl.id_limit = hhps.id_limit".
Josh
Site Admin
 
Posts: 6222
Joined: Sat Dec 08, 2007 6:03 pm

Re: how to get bb/100 ???

Postby MaxWeiss » Thu Apr 03, 2008 10:11 am

Thank you very much for all your help-- as you may have guessed I am learning SQL queries solely for this and don't have prior SQL experience... Anyway, I joined the table in the WHERE clause and now it works, except that the output numbers are now close to the listed BB/100 and sometimes the exact same, but generally the output is a few points plus or minus of what is listed in PT3 as BB/100. I have tried it with a dozen screen names and it's always in the same general order of magnitude (like it said 3.14 for a guy who was 2.76 and it said 33.47 for a guy who was 29.4 according to PT but then one guy it said 12.92 on both) but it's rarely the SAME as it is in PT3. What might cause this???

Thanks again Josh for all your help in teaching this to such a newbie!
MaxWeiss
 
Posts: 43
Joined: Sun Feb 10, 2008 10:40 pm

Re: how to get bb/100 ???

Postby Josh » Thu Apr 03, 2008 2:57 pm

It could be mismatched result sets, error in your SQL, or something else.

I'm curious though, why are you using SQL instead of the custom reports?
Josh
Site Admin
 
Posts: 6222
Joined: Sat Dec 08, 2007 6:03 pm

Re: how to get bb/100 ???

Postby MaxWeiss » Thu Apr 03, 2008 9:24 pm

I haven't actually looked into the custom reports yet. I am signed up to take a class on SQL (and also C#) and I'm just kind of looking for things to try and mess around with those. I just am interested in learning how to get the data myself and messing around with practice projects.

Anyway, thanks again for all the help!
MaxWeiss
 
Posts: 43
Joined: Sun Feb 10, 2008 10:40 pm


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

Who is online

Users browsing this forum: No registered users and 0 guests