最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

Oraclesubstr函数用法

来源:动视网 责编:小采 时间:2020-11-09 10:32:42
文档

Oraclesubstr函数用法

Oraclesubstr函数用法:Oracle substr函数用法取得字符串中指定起始位置和长度的字符串 substr( string, start_position, [ length ] );substr(字符串, Oracle substr函数用法 取得字符串中指定起始位置和长度的字符串 substr( string, start_posit
推荐度:
导读Oraclesubstr函数用法:Oracle substr函数用法取得字符串中指定起始位置和长度的字符串 substr( string, start_position, [ length ] );substr(字符串, Oracle substr函数用法 取得字符串中指定起始位置和长度的字符串 substr( string, start_posit


Oracle substr函数用法取得字符串中指定起始位置和长度的字符串 substr( string, start_position, [ length ] );substr(字符串,

Oracle substr函数用法

取得字符串中指定起始位置和长度的字符串 substr( string, start_position,

substr(字符串,截取开始位置,截取长度) //返回截取的字;

start_position为正时,从左往右获取字符串;

start_position为负时,从右往左获取字符串;

start_position为0时,从字符串开始位置获取字符串;

Examples:

1、start_position = 0

SELECT SUBSTR('hello',0,3) FROM dual; --hel
SELECT SUBSTR('hello',0,6) FROM dual; --hello
SELECT SUBSTR('hello',0,0) FROM dual; --null
SELECT SUBSTR('hello',0) FROM dual; --hello

2、start_position > 0

SELECT SUBSTR('hello',1,0) FROM dual; --null
SELECT SUBSTR('hello',1,2) FROM dual; --he
SELECT SUBSTR('hello',1,6) FROM dual; --hello
SELECT SUBSTR('hello',1) FROM dual; --hello

3、start_position < 0

SELECT SUBSTR('hello',-3) FROM dual; --'llo'
SELECT SUBSTR('hello',-1) FROM dual; --'o'
SELECT SUBSTR('hello',-3,2) FROM dual; --'ll'
SELECT SUBSTR('hello',-7) FROM dual; --null

相关阅读:

Oracle函数之Replace()

Oracle函数大全

Oracle函数之case和decode的用法区别及性能比较

Oracle函数和存储过程简单实例

Oracle函数 通过秒数或分钟数获取时间段

文档

Oraclesubstr函数用法

Oraclesubstr函数用法:Oracle substr函数用法取得字符串中指定起始位置和长度的字符串 substr( string, start_position, [ length ] );substr(字符串, Oracle substr函数用法 取得字符串中指定起始位置和长度的字符串 substr( string, start_posit
推荐度:
标签: 用法 函数 oracle
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top