on 2016 Feb 01 2:04 PM
I have to search a pattern in the string, however I am not getting desired result. Since in my pattern string I have a spacial characters like '_'.
Example: Pattern string is "MA_" and it should return only "MA_%" string however query returning values like "MAN%" and "MA_%..
Request clarification before answering.
Hi All,
I found the escape characters in HANA.
If you want to search for the percentage sign (%) or underscore (_), you have to place an ESCAPE character in front. You can choose the ESCAPE character (with some restrictions).
LIKE '$%%' ESCAPE '$'
String starting with a percentage sign
LIKE '$_ _' ESCAPE '$'
String of two characters starting with an underscore
LIKE '%$%' ESCAPE '$'
String ending with a percentage sign
LIKE '%$%%' ESCAPE '$'
String containing a percentage sign
LIKE '%$_$%%' ESCAPE '$'
String containing an underscore followed by a percentage sign
LIKE '_ _ _ _ $%_ $ _%' ESCAPE '$'
“%“ on fifth and “_“ on seventh position.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.