PL/SQL (MOSC)

MOSC Banner

regexp_like search all strings

edited Sep 25, 2012 1:15AM in PL/SQL (MOSC) 13 commentsAnswered ✓
  Hello,

I have a question about regexp_like function.
It is possible to use "or" operator (pipe) to search multiple strings in a string, like this:
select id from my_table where regexp_like(streetname,'york|new','i');
But as said before, this is OR operator.

Is there any way to use "and" operator, so the query would return only rows that contain ALL strings?

It is possilbe to use "and" operator in the where clause, like this:
select id from my_table where regexp_like(streetname,'york','i') and regexp_like(streetname,'new','i');

but this is not what I really want, because:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center