栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 数据库 > Oracle

oracle查询不含括号及不含指定字符的方法

Oracle 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

oracle查询不含括号及不含指定字符的方法

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相似。此处匹配了含有括号()和()的记录。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/171842.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号