Report Hands with Specific Notes

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

Report Hands with Specific Notes

Postby NimhOfJoy » Wed Feb 22, 2012 9:21 am

I've got my general "Marked for Review" hand report, but I was wondering how I could gen a report based on a specific note, i.e. "Marked for Discussion" or "Marked for Podcast".
NimhOfJoy
 
Posts: 142
Joined: Tue Jul 06, 2010 7:34 pm

Re: Report Hands with Specific Notes

Postby kraada » Wed Feb 22, 2012 9:55 am

The following filter will do what you want in a custom report:

holdem_hand_player_statistics.id_hand in (SELECT id_x from notes where enum_type = 'HH' and notes='Marked For Discussion')

Replace Marked for Discussion with whatever else you would like (though you do need those single quotes).
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Report Hands with Specific Notes

Postby NimhOfJoy » Thu Feb 23, 2012 9:00 am

Is the 'Marked for Discussion' bit case sensitive?
NimhOfJoy
 
Posts: 142
Joined: Tue Jul 06, 2010 7:34 pm

Re: Report Hands with Specific Notes

Postby kraada » Thu Feb 23, 2012 12:01 pm

Yes it is and as written matches the entire note. If you want to check for a subset of a note you could do something like:

notes LIKE '%arked%'

Then the query matches any note that includes "arked" as well as anything else before or after.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Report Hands with Specific Notes

Postby NimhOfJoy » Thu Feb 23, 2012 3:42 pm

Ok - I'd be aiming to make 3 reports:

Marked for review
Marked for discussion
Marked for podcast

First - what case does PT3 do on its own?

Second - could I do something like this:
LIKE '%arked %or %eview%'

to get all of those that are and aren't capitalized?
NimhOfJoy
 
Posts: 142
Joined: Tue Jul 06, 2010 7:34 pm

Re: Report Hands with Specific Notes

Postby kraada » Thu Feb 23, 2012 5:48 pm

You can't combine within the quotes in that way - easiest is to actually use OR between the entire expressions.

For example:

holdem_hand_player_statistics.id_hand in (SELECT id_x from notes where enum_type = 'HH' and notes LIKE '%arked%' OR notes LIKE '%eview%')
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


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

Who is online

Users browsing this forum: No registered users and 0 guests