The underscore _
is treated as a wild card in SQL, so it's actually trying to match any character.
In Oracle you can use an escape character to escape special characters:
select * from mn_table where status='Y' and upper(pl_name) like'%\_5M\_%' ESCAPE '\'
Alternatively, from Oracle LIKE docs:
You can also search for the escape character itself by repeating it.
For example, if @ is the escape character, then you can use @@ to
search for @.
select * from mn_table where status='Y' and upper(pl_name) like'%__5M__%' ESCAPE '_'