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 contained in the DB2 node lock file? A) data base names B) data base users names C) license keys D) server names
EXPLAIN has output with MATCHCOLS = 0. What does it mean?
How does coalesce work?
What is the syntax for seeing the columns and data types of a table in the db2 database?
What is the usage of open cursor command?
what are the copybook changes generally we done?can anyone tell me......... Thanks in advance........
what is diffrence b/w file-aid tool and file-aid utility???
Are views updatable ?
AGGREGATE function support by DB2. A) SUM & AVG B) SUM, MIN & AVG C) SUM, MAX, AVG , MIN &COUNT D) NONE
What is db2 command?
Why select is not preferred in embedded sql programs?
How can record locking be achieved in those DB2 versions which do not support it?