码迷,mamicode.com
首页 > 数据库 > 详细

oracle的substr函数的用法

时间:2016-11-12 11:32:54      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:style   indicator   select   turn   位置   http   blog   isis   用法   

取得字符串中指定起始位置和长度的字符串   substr( string, start_position, [ length ] )
技术分享 如:

     substr(‘This is a test‘, 6, 2)     would return ‘is‘
     substr(‘This is a test‘, 6)     would return ‘is a test‘
     substr(‘TechOnTheNet‘, -3, 3)     would return ‘Net‘
     substr(‘TechOnTheNet‘, -6, 3)     would return ‘The‘

  select substr(‘Thisisatest‘, -4, 2) value from dual    结果是   te

select substr(‘emros‘,-3,1) value from dual      结果是 r

 

substr(‘abcde‘,-6) = null 
substr(‘abcde‘,-5) = ‘abcde‘ 
substr(‘abcde‘,-4) = ‘bcde‘ 
substr(‘abcde‘,-3) = ‘cde‘ 
substr(‘abcde‘,-2) = ‘de‘ 
substr(‘abcde‘,-1) = ‘e‘ 
substr(‘abcde‘,-0) = ‘abcde‘

 

oracle的substr函数的用法

标签:style   indicator   select   turn   位置   http   blog   isis   用法   

原文地址:http://www.cnblogs.com/alsf/p/6056205.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!