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.
Answer Posted / 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 |
Post New Answer View All Answers
Define db2 and its databases?
Following a db2 update statement, what is the quickest way to compute the total number of updated rows?
What is runstats and reorg in db2?
What is bufferpool in db2?
While unloading huge amount of data from table. Suddenly job failed some error. Imagine 1M data unloading, In that 90% data unloaded only 10% left, So if want to unload the rest 10% what needs to be done? Whether do i need to start from top or anything ?
What is netezza database?
Mention the different locking levels that are available in db2.
What is database alias db2?
How does a cursor work?
Why do we use cursor?
How do I delete a column in db2?
How do you simulate the explain of an embedded sql statement in spufi/qmf?
What are the uses of db2 optimizer?
Mention some fields that are a part of sqlca.
How do I add a column to a table in db2?