Open Side Menu Go to the Top

03-13-2009 , 12:15 AM
Hi,

I liked the old Setometer program for PT2, because I like being told how unlucky I am. I wanted something that did the same trick for PT3, but I'm too lazy to write an actual application, so I wrote an SQL query. I'm posting it here in case anyone else wants to use it.

Instructions for use: Open pgIII Admin (a link to it should be in the Postgres folder in your Start menu from when PT3 installed Postgres). Connect to the server (you'll have to remember what the password was) and navigate to the PT3 database. In the top bar of buttons there's one with a pencil writing on paper labeled "SQL". Click that and paste this in there:

Code:
SELECT	lhc.id_holecard,
	lhc.hole_cards,
	COUNT(hhps.id_hand) AS Total,
	SUM(CASE WHEN hhpc.flg_f_threeoak = true OR hhpc.flg_f_fouroak = true OR (hhpc.flg_f_fullhouse = true AND NOT (MOD(hhs.card_1, 13) = MOD(hhs.card_2, 13) AND MOD(hhs.card_1, 13) = MOD(hhs.card_3, 13))) THEN 1 ELSE 0 END) AS Sets,
	CAST(SUM(CASE WHEN hhpc.flg_f_threeoak = true OR hhpc.flg_f_fouroak = true OR hhpc.flg_f_fullhouse = true THEN 1 ELSE 0 END) * 100 AS numeric)/COUNT(hhps.id_hand) AS Percentage
FROM	holdem_hand_player_statistics hhps
	LEFT JOIN holdem_hand_player_combinations hhpc ON hhps.id_hand = hhpc.id_hand AND hhps.id_player = hhpc.id_player
	INNER JOIN lookup_hole_cards lhc ON hhps.id_holecard = lhc.id_holecard
	INNER JOIN holdem_hand_summary hhs ON hhps.id_hand = hhs.id_hand
	INNER JOIN player ON hhps.id_player = player.id_player
WHERE	player.player_name = 'xxxxxx'
        AND lhc.flg_pair = true
        AND hhps.flg_f_saw = true
        --AND hhs.date_played > CAST('1/1/2009' AS timestamp)
GROUP BY lhc.hole_cards, lhc.id_holecard
ORDER BY lhc.id_holecard;
In the line:

WHERE player.player_name = 'xxxxxx'

replace xxxxxx with your PT3 player name - the one all your other screen names are aliased to. If you want your set results only since a certain date, change the line:

--AND hhs.date_played > CAST('1/1/2009' AS timestamp)"

to remove the two leading dashes and change the date to whatever you want (MDY format).

Press F5 or click green arrow to run it. You can cut and paste the results into Excel (choose semicolon delimited on the input) if you want to mess around with the numbers.

Note that the "Total" number of pairs dealt it gives isn't the absolute number you were dealt, but the number you saw a flop with.

Also coming soon from ChrisV: How much have I lost/won at AA vs KK matchups?
PT3 Setometer SQL query Quote
PT3 Setometer SQL query
150% up to $2,000 Welcome Bonus on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
PT3 Setometer SQL query
03-14-2009 , 10:04 AM
Nice but there's a cleaner way to write this query.
PT3 Setometer SQL query Quote
03-14-2009 , 08:26 PM
no doubt. im not really familiar with the schema. i just hacked at it till it was working. its not pretty.
PT3 Setometer SQL query Quote
PT3 Setometer SQL query
150% up to $2,000 Welcome Bonus on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
PT3 Setometer SQL query

      
m