SQL中Charindex和Oracle中对应的函数Instr对比
来源:互联网 发布:淘宝商品采集工具 编辑:程序博客网 时间:2024/05/21 07:56
转自:http://www.jb51.net/article/42369.htm
sql :charindex('字符串',字段)>0 charindex('administrator',MUserID)>0
oracle:instr(字段,'字符串',1,1) >0 instr(MUserID,'administrator',1,1)>0
在项目中用到了Oracle中 Instr 这个函数,顺便仔细的再次学习了一下这个知识。
Oracle中,可以使用 Instr 函数对某个字符串进行判断,判断其是否含有指定的字符。
其语法为:
Instr(string, substring, position, occurrence)
其中
string:代表源字符串;
substring:代表想聪源字符串中查找的子串;
position:代表查找的开始位置,该参数可选的,默认为 1;
occurrence:代表想从源字符中查找出第几次出现的substring,该参数也是可选的,默认为1;
如果 position 的值为负数,那么代表从右往左进行查找。
返回值为:查找到的字符串的位置。
对于 Instr 函数,我们经常这样使用:从一个字符串中查找指定子串的位置。
例如:
SELECT Instr('Hello Word', 'o', -1, 1) "String" FROM Dual 的显示结果是
Instring
————
8
0 0
- SQL中Charindex和Oracle中对应的函数Instr
- SQL中Charindex和Oracle中对应的函数Instr
- SQL中Charindex和Oracle中对应的函数Instr
- SQL中Charindex和Oracle中对应的函数Instr
- SQL中Charindex和Oracle中对应的函数Instr对比
- Oracle中INSTR函数与SQL Server中CHARINDEX函数
- ORACLE数据库中函数instr和SQLServer数据库中CHARINDEX函数
- SQL中left()函数和charindex()函数的使用
- oracle中instr函数
- oracle中instr函数
- Oracle中instr函数
- Oracle中 instr 函数
- Oracle中 instr 函数
- oracle中instr函数
- oracle中instr函数和substr函数的浅用法
- Oracle中substr函数和instr函数的结合使用
- oracle中substrb和instr函数用法
- sql 中charindex 和 replace的用法
- cmake:设置编译选项的讲究(add_compile_options和CMAKE_CXX_FLAGS的区别)
- Unity 粒子海洋效果实现
- 企业项目管理redmine搭建
- Linux系统软件安装方式介绍
- linux安装memcache
- SQL中Charindex和Oracle中对应的函数Instr对比
- PostScript文件(.ps)转化为PDF
- 关于 js 微信分享 微博分享 新浪微博分享 易信分享
- Unity 用简单工厂模式创建对象
- IOS应用内跳转系统设置相关界面的方法
- 文章标题
- sphinx安装
- cocos 本周学习api
- Leetcode Word Break