Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Wild card characters search

Posted on 2009-04-28
2
Medium Priority
?
4,537 Views
Last Modified: 2012-05-06
1) When we have % and _ in data of column in table, how do we search for these values using wild card search?
2) What I mean is:
SELECT C1 FROM T1 WHERE C1 LIKE '%_AB%_C';
In this case first %_ should be treated as characters of data and second %_ as wild card characters.
0
Comment
Question by:k_murli_krishna
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 24253917
you have to specify a ESCAPE character:
http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db29.doc.sqlref/db2z_likepredicate.htm
SELECT C1 FROM T1 WHERE C1 LIKE '+%_AB%_C' ESCAPE '+';

Open in new window

0
 
LVL 17

Author Closing Comment

by:k_murli_krishna
ID: 31575619
Thanks, angel.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month20 days, 23 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question