Generally if I want to select the names starting with c I
need to use c%
But how could I code to select the data which contains %
as a part of data.
Answers were Sorted based on User's Feedback
Answer / mdvasanth86
Anand is right.
SELECT * FROM table_name WHERE column_name LIKE 'C!%'
ESCAPE'!';
If you want to use % or _ as part of your like clause,
you must have an escape character before each occurrence of
% or _ and define what the escape character is like above.
So, an escape character before the % or _ will make it part
of the string rather than a wildcard character(S).
HTH
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / guest
C% will work for all the cases. Even if the data contains
%, Using C% will fetch that too.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / anand
hi,
it may be correct ans.check out this..
SELECT * FROM table_name WHERE column_name LIKE 'C%%'
ESCAPE'%';
Is This Answer Correct ? | 2 Yes | 3 No |
What can the SET option of the Repair Utility accomplish?
How to execute stored procedures?
What is db2 stogroup?
What keyword does an SQL SELECT statement use for a string search?
What is the purpose of the WHENEVER statement?
4. A DB2 application is bound with uncommitted Read isolation level.It issues a request that retrieves 20 rows out of 200000 in the table. Which of the following descrbes the rows that are locked as a result of this request? a. None of the rows are locked. B.The retrieved rows are locked. C.The last row of the result set is locked. D.The rows not previously updated by another application are locked.
what are stage one indexable predicates?
Assuming that a site's standard is that pgm name = plan name, what is the easiest way to find out which Will precompile of an DB2-COBOL program bomb, if DB2 is down?
What is deadlock?
What error I will get if my select query gives multiple row while executing a Cobol-DB2 program.How can I solve it without using a cursor.
4 Answers Cap Gemini, Verizon,
What is a storage group (stogroup)?
how to resolve -811