zoukankan      html  css  js  c++  java
  • oracle的substr函数的用法

    oracle的substr函数的用法
     取得字符串中指定起始位置和长度的字符串   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'

  • 相关阅读:
    5.14事务
    5.13Mysql数据库Database
    未来打算
    浅谈P NP NPC
    1222
    1219
    Linux初等命令
    惩罚因子(penalty term)与损失函数(loss function)
    12 14
    java 泛型思考
  • 原文地址:https://www.cnblogs.com/alsf/p/6128109.html
Copyright © 2011-2022 走看看