Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Regular expressions in SQL?

I want to use a regular expression in Oracle 11g SQL to find records that do not match it. The regular expression is:

/([A-Z]{3})+([0-9])\w+/g

The SQL I want to use would be something like:

select
  stu_code
  ,stu_insc
from
  intuit.ins_stu
where
  stu_insc not like ('/([A-Z]{3})+([0-9])\w+/g')

Obviously I know the above is not right, so does anyone know how I do this? I do not have the rights to run any PL/SQL.

like image 267
Andy Kaufman Avatar asked Dec 29 '25 10:12

Andy Kaufman


1 Answers

On oracle you can try something along the lines of

select xyz
from theTable
where not regexp_like(mycolumn,pattern)
like image 179
piet.t Avatar answered Dec 31 '25 05:12

piet.t



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!