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's the equivalent Cobol Data type for Decimal(x,y) in DB2? what does the current SQLID register contain?
3 Answers Cap Gemini, Tech Mahindra,
What does db2 blu stand for?
pls tell me abt the normalization five types....
What does reorg do in db2?
Name some fields from SQLCA
What is the self-referencing constraint?
How does DB2 store NULL physically?
How do I delete a column in db2?
What does the sqlcode of -818 pertain to?
How can you do the explain of a dynamic sql statement?
How do you Load a table ?? and what is Load replace ?
Give some example of statistics collected during RUNSTATS?