[support] SQL Query - "LIKE" usage

Ms. Nancy Wichmann nan_wich at bellsouth.net
Fri May 20 01:46:43 UTC 2011


The problem is not the "s."  You wanted a "%" to be in the query. The corrects 
way to do that, as the API doc states, is with "%%". That's why it worked when 
you changed it.
 
Nancy
 
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.



________________________________

From: Austin Einter
str = SELECT name, id, lft, rgt FROM resubmt_skill_ids AS node WHERE ( node.name 
LIKE "%sip%") ORDER BY node.lft

On debugging, looks the query went as 
SELECT name, id, lft, rgt FROM resubmt_skill_ids AS node WHERE ( node.name LIKE 
"ip%") ORDER BY node.lft

Then I changed the query to 

SELECT name, id, lft, rgt FROM resubmt_skill_ids AS node WHERE ( node.name LIKE 
"%%sip%") ORDER BY node.lft
Above query returns expected records.

My question is , when a token starts with "s", we will be facing above issue.
What is the best way to resolve it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20110519/044be29d/attachment.html 


More information about the support mailing list