本文介绍了oracle等效于patindex和instr函数(带通配符)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有与patindex相对应的Oracle?根据我的搜索,唯一接近patindex的函数是oracle的instr函数,但它不支持通配符.

is there an oracle equivalent of patindex? from my search, the only function that is close to patindex is oracle's instr function but it does not support wild card.

以下查询的oracle等效项是什么?

what is the oracle equivalent of the following query?

select patindex('%[^0]%','00194505022') 

我发现regexp_instr具有与patindex类似的功能.

edit: i found out regexp_instr have the similar function as patindex.

推荐答案

有regexp_instr使用标准正则表达式语法进行模式匹配.

There's regexp_instr that uses standard regular expression syntax for pattern matching.

select regexp_instr('00194505022','[^0].*') from dual;

这篇关于oracle等效于patindex和instr函数(带通配符)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 13:52