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 is the use of dclgen in db2?
wht displays the number of times a query modified ?
Explain the contents that are a part of dclgen.
what is consistency token
what is the use of bind parameter, Replace?
How will fetch last 5 rows from table in db2
what is the certification that has a good value for a practioner in mainframes but not habving much knowledge on db2 related stuff?
Explain the benefits you can get from mainframe connect?
Define db2.
What is the maximum length of sqlca?
What is an access path?
What are delete-connected tables?