加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

正则表达式

发布时间:2020-12-13 22:58:25 所属栏目:百科 来源:网络整理
导读:+ 匹配一次及以上* 匹配0次及以上SQL select * from a1;NAME----------abcabcdefabccccSQL select * from a1 where name like '%abc%';NAME----------abcabcdefabccccSQL select * from a1 where regexp_like(name,'abc');NAME----------abcabcdefabccccSQL
+ 匹配一次及以上
* 匹配0次及以上


SQL> select * from a1;

NAME
----------
abc
abcdef
abcccc

SQL> select * from a1 where name like '%abc%';

NAME
----------
abc
abcdef
abcccc



SQL> select * from a1 where regexp_like(name,'abc');

NAME
----------
abc
abcdef
abcccc

SQL>  select * from a1 where regexp_like(name,'^abc$');

NAME
----------
abc

'abc' 等价于 like '%abc%'


SQL> select * from a1;

NAME
----------
abc
abcdef
abcccc
ab

SQL> select * from a1 where regexp_like(name,'abc+');

NAME
----------
abc
abcdef
abcccc


SQL>  select * from a1 where regexp_like(name,'z*');

NAME
----------
abc
abcdef
abcccc
ab

SQL> select * from a1 where regexp_like(name,'1*');

NAME
----------
abc
abcdef
abcccc
ab
匹配0个或者多个1


select * from a1 where regexp_like(name,'16*');
相当于

select * from a1 where name like '%1%'

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读