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 |
When reorg is used?
What is plan in cobol db2?
select 100 records from million records ?
What is EXPLAIN?
My DB2 program first read the data from a file and then it look into a table with the data it got from the file.If we did not bind the program , should the file read before SQL execution be success??
How can the duplicate values be eliminated from db2 select?
Define db2.
What is temporal table in db2?
Explain the function done by data manager?
what is utility for parm lib
What is the difference between drop table and delete table?
What do you mean by cursor?