Page 1 of 1

holdem_table_session_summary.id_session from last session

PostPosted: Wed Jul 20, 2011 3:39 am
by Foxy79
Hi,

I need the holdem_table_session_summary.id_session´s from the last played session. As I have seen PokerTracker saved every Table as a own id_session.
If I play 3 Tables at the same time in my last session, there are 3 id´s that I need.
Can anyone help with the SQL query for that id´s ?

Thank u a lot.

Re: holdem_table_session_summary.id_session from last sessio

PostPosted: Wed Jul 20, 2011 8:43 am
by kraada
If you enable logging and click on the Sessions tab of PT3, you can see the queries that PT3 uses to get your data in the log file.

Re: holdem_table_session_summary.id_session from last sessio

PostPosted: Wed Jul 20, 2011 11:50 am
by Foxy79
Thank you, where can I enable logging?

Re: holdem_table_session_summary.id_session from last sessio

PostPosted: Wed Jul 20, 2011 12:57 pm
by kraada
On a PC if you run PT3 through the (Logging Enabled) link on your start menu it wills tart with logging for that session. On a Mac if you hold ctrl and click on the PT icon on the dock PT3 will start with logging enabled for that session. For both operating systems if you click Configure --> Logging --> Logging Enabled, logging will be enabled for the next start, and remain enabled afterwards until you disable it.

Re: holdem_table_session_summary.id_session from last sessio

PostPosted: Thu Jul 21, 2011 2:41 am
by Foxy79
I always startet PT3 from Desktop Icon, so I never that option :oops: sorry.
I have looked in the log files, but I not find how PT3 find the id that played at the same time:
AND holdem_hand_player_statistics.id_session in (121313, 121283, 121300, 121294, 121301)
How gets PT3 the id´s 121313, 121283, 121300, 121294, 121301?

Re: holdem_table_session_summary.id_session from last sessio

PostPosted: Thu Jul 21, 2011 3:46 am
by WhiteRider
You could search for sessions where the end time is within the last x minutes - bear in mind that times are stored in UTC so you may need to adjust the number of minutes.

e.g. in a custom report in the Holdem Cash Session section a filter like this works:
#End Time# > (now() - interval '5 minutes')

The database field for the end of the session is "holdem_table_session_summary.date_end".

Re: holdem_table_session_summary.id_session from last sessio

PostPosted: Thu Jul 21, 2011 7:23 am
by Foxy79
Ok, thank u a lot.
If anyone else need that query, here is my solution:
Code: Select all
SELECT DISTINCT (holdem_table_session_summary.date_end) as "date_end", (holdem_table_session_summary.id_session) as "id_session"
 FROM holdem_table_session_summary
 WHERE  holdem_table_session_summary.id_player = 660 AND
 holdem_table_session_summary.date_end >
   ((SELECT (holdem_table_session_summary.date_end) as "date_end" FROM holdem_table_session_summary WHERE  holdem_table_session_summary.id_player = 660
   ORDER BY (holdem_table_session_summary.date_end) desc LIMIT 1) - interval '2 hour')
 ORDER BY (holdem_table_session_summary.date_end) desc