oracle查询不含括号及不含指定字符的方法
程序员文章站
2022-06-29 22:03:38
oracle查询不含括号不含指定字符的记录方法如下:
with tmp_t as(
select 1 as id,'测试4321_cs' as name f...
oracle查询不含括号不含指定字符的记录方法如下:
with tmp_t as( select 1 as id,'测试4321_cs' as name from dual union all select 2,'测试 1200(测试版)' from dual union all select 3,'测试123(测试版)' from dual union all select 4,'测试 1212(d2)' from dual union all select 5,'测试 1212(d2)测试版' from dual union all select 6,'测试 123' from dual) select * from tmp_t where instr(name, '_cs') = 0 and regexp_instr(name, '(.*)') = 0 and regexp_instr(name, '\(.*\)') = 0
结果为:
其中regexp_instr为oracle支持的正则表达式函数,其功能与instr相似。此处匹配了含有括号()和()的记录。
下一篇: linux下安装jira详细步骤