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


Please Help Members By Posting Answers For Below Questions

Explain the contention situations caused by locks?

589


What is the cobol picture clause of the db2 data types date, time, timestamp?

614


What is host variable in db2 cobol?

602


Is db2 relational database?

572


What are catalog tables in db2?

604






How can you do the explain of a dynamic sql statement?

635


How can tablespace be moved to another dasd volume that is allocated for that tablespace?

743


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 ?

1818


What is image copy in db2?

567


What is the use of predicate?

584


What is isolation level in db2?

577


What is cursor in dbms?

589


How to take backup of table in db2?

599


What is the physical storage length of the data types date, time, and timestamp?

604


What is the use of value function?

622