巷尾的酒吧

            BlogJava :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
            64 Posts :: 0 Stories :: 5 Comments :: 0 Trackbacks

          oracle的substr函數(shù)的用法
           取得字符串中指定起始位置和長度的字符串   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    結(jié)果是   te

          select substr('emros',-3,1) value from dual      結(jié)果是 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'

          posted on 2012-10-11 17:49 abing 閱讀(226) 評論(0)  編輯  收藏 所屬分類: oracle
          主站蜘蛛池模板: 隆子县| 平舆县| 上饶市| 崇义县| 桦甸市| 轮台县| 湛江市| 固镇县| 曲靖市| 和平区| 靖安县| 扎囊县| 治多县| 沁源县| 绥化市| 莎车县| 九寨沟县| 仁寿县| 红河县| 宁都县| 霍林郭勒市| 吴旗县| 志丹县| 东至县| 河北省| 即墨市| 栾城县| 临高县| 安图县| 罗定市| 福建省| 恩平市| 杂多县| 泗洪县| 盈江县| 施秉县| 乌兰县| 湟中县| 凌海市| 常熟市| 安庆市|