archavin archavin - 6 months ago 22
SQL Question

Oracle 10g SQL like using REGEXP_LIKE

To extract only the appropriate rows, i have to do something like Mycolum in ('x%','f%') : wich means i want all the rows where Mycolumn is starting with

x
or
f
,

i can use
REGEXP_LIKE(Mycolumn, '^x', 'i')
: to extract all rows where Mycolumn start with
x
how can i add OR in regex to tell to my function i need also rows starting with
f


thanks

Answer

You can do this:

REGEXP_LIKE(Mycolumn, '^[xf]')