orcl regexp_like 的用法
oracle10g以上支持正则表达式的函数主要有下面四个: ------------------------------------------------------------------------------ 创建测试环境: create table bqh5 (id varchar(4),zh varchar(10)); ?查询zh中以1开头0结束的并且长度是8位的数据: select * from bqh5 where zh like ‘1______0‘ ?? ?select * from bqh5 where regexp_like(zh,‘1......0‘); ?查询zh中以1开头0结束的并且长度是8位并且全部时数字的数据: select * from bqh5 where regexp_like(zh,‘1[0-9]{5}70‘); ? 查询zh中不是纯数字的数据: select * from bqh5 where not regexp_like(zh,‘^[[:digit:]]+$‘); ? 查询zh中不含任何数字的数据: ?select * from bqh5 where ?regexp_like(zh,‘^[^[:digit:]]+$‘); 查询以12或者以1d开头的数据,不区分大小写: select * from bqh5 where ?regexp_like(zh,‘^1[2d]‘,‘i‘); ? 查询以12或者以1d开头的数据,区分大小写: ?select * from bqh5 where ?regexp_like(zh,‘^1[2D]‘); 查询包含空格的数据: ?select * from bqh5 where ?regexp_like(zh,‘[[:space:]]‘); 查询包含标点符号的数据: select * from bqh5 where ?regexp_like(zh,‘[[:punct:]]‘); ? 查询包含数字或者字母的数据: ?select * from bqh5 where ?regexp_like(zh,‘^([[0-9]+)$+|[a-z]‘,‘i‘); --------------------------------------------------------------------------------- 感谢您的阅读,如果您觉得阅读本文对您有帮助,请点一下“推荐”按钮。本文欢迎各位转载,但是转载文章之后必须在文章页面中给出作者和原文连接。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- c – 在一个大的MFC Windows专用应用程序中使用Qt会加速开发
- 在velocity使用toolbox.xml
- Flex带参数监听函数
- 如何在 React Native 中写一个自定义模块
- c – 使用Win32线程模型时,MinGW-w64是否支持std :: thread
- XML解析SAX
- c# – 为什么Interlocked.CompareExchange仅支持引用类型?
- ArcGIS.Server.9.3和ArcGIS API for Flex的GeoprocessingSe
- React.js 小书 Lesson10 - 组件的 state 和 setState
- webpack+vuex+axios 跨域请求数据的示例代码