lookup_actions LIKE vs lookup_actions =

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

lookup_actions LIKE vs lookup_actions =

Postby marvin » Wed Jan 25, 2012 5:38 am

1) what is the difference between lookup_actions_f.action LIKE 'X' and lookup_actions_f.action = 'X' , or lookup_actions_f.action LIKE 'X_%' and lookup_actions_f.action = 'X_%'?
2) in lookup_actions_f.action LIKE 'X' arent considered also the action XR, XF, XC right? (I think they are counted only using lookup_actions_f.action LIKE 'X%')
3) lookup_actions_f.action LIKE 'X_%' counts only XR, XF, XC and naturally actions like XRRC or XCC (if multiway pot) but not actions ONLY X (WHY all players check)
marvin
 
Posts: 327
Joined: Tue Jul 08, 2008 10:17 am

Re: lookup_actions LIKE vs lookup_actions =

Postby kraada » Wed Jan 25, 2012 11:03 am

(1) lookup_actions_f.action LIKE 'X' and lookup_actions_f.action = 'X' are identical and can be used interchangeably - they mean the person only checked on the flop and took no other action. lookup_actions_f.action LIKE 'X_%' means that the player checked (X) took some second action (_ means some character but it doesn't matter what) and then may or may not have taken any more actions after (%). lookup_actions_f.action = 'X_%' is invalid syntax and will not match any data.

(2) Correct. % is the wildcard - without it, it tests only exactly what you have written.

(3) Correct. _ means there must be something there.

Edit: Edited the end of (1) for clarity.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: lookup_actions LIKE vs lookup_actions =

Postby WhiteRider » Wed Jan 25, 2012 1:28 pm

kraada wrote:(1) ... lookup_actions_f.action = 'X_%' is invalid syntax and will not validate.

To clarify - it will validate because it is still a valid string of text, but it won't match anything when you use = because an actions string can never include the actual characters _ or %, and 'equals' tests for an exact match. Those characters only mean anything when you use pattern matching expressions 'LIKE' or 'SIMILAR TO'.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: lookup_actions LIKE vs lookup_actions =

Postby marvin » Wed Jan 25, 2012 6:01 pm

great, ty for your last clarify!!
marvin
 
Posts: 327
Joined: Tue Jul 08, 2008 10:17 am


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

Who is online

Users browsing this forum: No registered users and 11 guests