instr
来源:互联网 发布:hadoop 1T数据 编辑:程序博客网 时间:2024/06/05 08:48
instr(string1,string2[,start_position[,nth_appearence]])
string1:要在此字符串中查找。
string2:要在string1中查找的字符串。
start_position:从string1开始查找的位置。可选,默认为1,正数时,从左到右检索,负数时,从右到左检索。
nth_appearence:查找第几次出现string2。可选,默认为1,不能为负。
注:如果没有查找到,返回0。
例如:
select instr('abcd','a') from dual; --返回1
select instr('abcd','c') from dual; --返回3
select instr('abcd','e') from dual; --返回0
该函数可以用于模糊查询以及判断包含关系:
例如:
① select code, name, dept, occupation from staff where instr(code, '001') > 0;
等同于
select code, name, dept, occupation from staff where code like '%001%' ;
② select ccn,mas_loc from mas_loc where instr('FH,FHH,FHM',ccn)>0;
等同于
select ccn,mas_loc from mas_loc where ccn in ('FH','FHH','FHM');
0 0
- instr
- Instr()
- INSTR
- INSTR
- Instr()
- instr
- InStr函数
- Instr Function
- Instr函数
- instr函数
- instr用法
- InStr 函数
- oracle instr
- ORACLE INSTR()
- INSTR方法
- oracle instr
- Instr 函数
- SUBSTR,INSTR
- 权限修饰符
- 【hdoj_1865】1sting(递推+大数)
- 架构搭建
- nginx配置(三)重定向
- Python模块之ConfigParser
- instr
- windos杀死进程
- java发送邮件源码
- 通信网络中的透传到底什么意思?
- 2017年你不能错过的Java类库
- selenium2java自定义一个用js点击元素的方法
- hadoop设置ssh免密码登陆
- git diff 文件
- [BZOJ2002][[Hnoi2010]Bounce 弹飞绵羊]