View previous topic :: View next topic
|
Author |
Message |
neelesht
New User
Joined: 24 Jul 2006 Posts: 99 Location: Los Angeles
|
|
|
|
Hi All,
If I have a string as 'NEEL%SH' then how would I use the LIKE query for this particular string, suppose in LIKE I want to give"NEEL%" as first 5 characters.
Please let me knw what will be the query and also let me know is it allowed to use '%' in the VARCHAR string.
Thanks
Neelesh |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi there,
U can use escape along with like
escape-expression
This optional argument is an expression that specifies a character to be used to modify the special meaning of the underscore (_) and percent (%) characters in the pattern-expression. This allows the LIKE predicate to be used to match values that contain the actual percent and underscore characters.
For ur query u can use
Code: |
Where col_name LIKE 'NEEL\%%' ESCAPE '\'; |
Hope it will helpful |
|
Back to top |
|
|
|