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

What is null indicator in cobol db2?

818


What are types of indexes?

812


Which component is used to execute the sql statements?

881


How do I add a column to an existing table in db2?

816


What is the use of with ur in db2?

840


What is the advantage in De-normalizing tables in DB2?

973


How does db2 sample database connect?

808


Give a brief description of db2 isolation levels?

818


What is cursor with hold option in db2?

850


Explain correlated sub-queries.

805


What do you mean by between and in? Is between inclusive of specified range values?

898


List down the data types in the db2 database.

842


What is meant by dclgen?

896


How to create db2 table in mainframe?

894


is it compulsory commitment control in journal?

2261