最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
oralce substr字符截取函数用法
时间:2022-06-29 10:10:05 编辑:袖梨 来源:一聚教程网
在几乎所有的数据库教程中都会有字符截取这个函数,都大同小义了,下面我们来看看在Oralce中有个数据切割函数: substr的用法吧。
substr('要切割的值',从第几个位置开始切割,切割几位);
如下例:
view sourceprint?substr('hello word', 3, 2) would return 'll'
substr('hello word', 5) would return 'o word'
substr('hello word', -3, 3) would return 'ord'
substr('hello word', -6, 3) would return 'o w'
substr('hello word', -8, 2) would return 'll'
substr( string, start_position, [ length ] )
说明:
string is the source string.
start_position is the position for extraction. The first position in the string is always 1.
length is optional. It is the number of characters to extract. If this parameter is omitted, substr will return the entire string.
For example:
substr('This is a test', 6, 2) would return 'is'
substr('This is a test', 6) would return 'is a test'
substr('TechOnTheNet', 1, 4) would return 'Tech'
substr('TechOnTheNet', -3, 3) would return 'Net'
substr('TechOnTheNet', -6, 3) would return 'The'
substr('TechOnTheNet', -8, 2) would return 'On'
相关文章
- 原神安魂曲任务怎么完成 原神安魂曲任务完成方法 04-27
- 保卫萝卜4阿波与魔法宝藏第2关满星攻略 保卫萝卜4阿波与魔法宝藏第二关怎么过 04-27
- 保卫萝卜4阿波与魔法宝藏第1关满星攻略 保卫萝卜4阿波与魔法宝藏第一关怎么过 04-27
- 原神被缚的囚徒任务怎么攻略 04-27
- 原神久岐忍突破材料全收集攻略(鸣草+符纹之齿+祸神之契泪+飘浮灵讨伐路线) 04-27
- 王者荣耀项羽苍威无极价格一览 04-27