September 24th, 2003, 11:22 AM
underscore search in oracle
I need to search the name that contains underscore.
The query I sent was
select name from table where name like '%N__% ;
and I get all the names that has single underscore too
My output was
whereas I should be getting only N__1
I understand that '_' is a special character like '%' in oracle.Difference being '_' is for single character match & '%' is for any number of characters match.
Any help how to modify my query to get the required name only ?
Thanks in advance.
September 24th, 2003, 01:59 PM
select name from table where name like '%N\_%' ESCAPE '\';
Last edited by Dan Drillich; September 24th, 2003 at 02:01 PM.
September 24th, 2003, 03:11 PM
Thanks. Already got it working.