Oracle substr函數用法,oraclesubstr函數

來源:互聯網
上載者:User

Oracle substr函數用法,oraclesubstr函數

oracle的substr函數的用法
 取得字串中指定起始位置和長度的字串   substr( string, start_position, [ length ] )
 如:
     substr('This is a test', 62)     would return 'is'
     substr('This is a test', 6)     would return 'is a test'
     substr('TechOnTheNet', -33)     would return 'Net'
     substr('TechOnTheNet', -63)     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'

 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.