Here are examples of Oracle SQL queries to find substring in a string.
Find Substring in a String Using INSTR() Function Examples
In Oracle, the instr()
function returns the position of a substring in the string. So if the substring exists in the string, it will return its position; if not exists, then it returns 0. Below is an example:
select instr('Oracle SQL Query', 'SQL') from dual;
Output:
8
select instr('Oracle SQL Query', 'Select') from dual;
Output:
0
select * from employees where instr(emp_name, 'Mr.') > 0;
Leave a comment