holdem_table_session_summary.id_session from last session

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

holdem_table_session_summary.id_session from last session

Postby Foxy79 » Wed Jul 20, 2011 3:39 am

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.
Foxy79
 
Posts: 10
Joined: Wed May 14, 2008 1:08 pm

Re: holdem_table_session_summary.id_session from last sessio

Postby kraada » Wed Jul 20, 2011 8:43 am

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.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: holdem_table_session_summary.id_session from last sessio

Postby Foxy79 » Wed Jul 20, 2011 11:50 am

Thank you, where can I enable logging?
Foxy79
 
Posts: 10
Joined: Wed May 14, 2008 1:08 pm

Re: holdem_table_session_summary.id_session from last sessio

Postby kraada » Wed Jul 20, 2011 12:57 pm

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.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: holdem_table_session_summary.id_session from last sessio

Postby Foxy79 » Thu Jul 21, 2011 2:41 am

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?
Foxy79
 
Posts: 10
Joined: Wed May 14, 2008 1:08 pm

Re: holdem_table_session_summary.id_session from last sessio

Postby WhiteRider » Thu Jul 21, 2011 3:46 am

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".
WhiteRider
Moderator
 
Posts: 54017
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: holdem_table_session_summary.id_session from last sessio

Postby Foxy79 » Thu Jul 21, 2011 7:23 am

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
Foxy79
 
Posts: 10
Joined: Wed May 14, 2008 1:08 pm


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

Who is online

Users browsing this forum: No registered users and 21 guests

cron
highfalutin