I want to find the column names having underscore ‘_’ i wrote the following query :-
select * from dba_tab_cols where column_name like '%_%';
but it return all the column names.
For time being i thought oracle went crazy but underscore ‘_’ means different things in the oracle.isn’t it. Now what about my problem. For this kind of problem we need to use escape character in LIKE operator. For ex:-
select * from dba_tab_cols where column_name like '%i_%' escape 'i';
and it’s working as expected. Instead of ‘i’ you can use anything. But if you