当前位置:网站首页>Oracle/PLSQL: Substr Function
Oracle/PLSQL: Substr Function
2022-06-27 01:45:00 【yuanlnet】
In Oracle/PLSQL, the substr functions allows you to extract a substring from a string.
Syntax
The syntax for the substr function is:
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.
Note
If start_position is 0, then substr treats start_position as 1 (ie: the first position in the string).
If start_position is a positive number, then substr starts from the beginning of the string.
If start_position is a negative number, then substr starts from the end of the string and counts backwards.
If length is a negative number, then substr will return a NULL value.
Applies To
- Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i
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' |
边栏推荐
- Ml: a detailed introduction to the division of the top ten roles, backgrounds, responsibilities and outputs of the machine learning engineering team
- 学习DiscoDiffusion的最基础操作
- XSS attack notes (Part 1)
- 消费者追捧iPhone,在于它的性价比超越国产手机
- Amazon elasticache quickly builds a cache service cluster, which is fast
- Oracle/PLSQL: HexToRaw Function
- George Washington University: Hanhan Zhou | PAC: auxiliary value factor decomposition with counterfactual prediction in Multi-Agent Reinforcement Learning
- Memcached foundation 6
- 热议:月薪1.8万却毫无意义的工作,你干吗?
- 速看!2022年6月编程语言排行榜出炉!第一名太牛啦
猜你喜欢
在 IDEA 里看个书很过分嘛!

Topolvm: kubernetes local persistence scheme based on LVM, capacity aware, dynamically create PV, and easily use local disk

二叉树oj题目

Markdown table (consolidated)

CLIP:从自然语言监督中学习可迁移的视觉模型

Systematic analysis of social networks using Networkx: Facebook network analysis case

getReader() has already been called for this request

Online text digit recognition list summation tool

Daily question brushing record (V)

Some exception handling for idea plug-in development
随机推荐
Topolvm: kubernetes local persistence scheme based on LVM, capacity aware, dynamically create PV, and easily use local disk
idea 插件开发一些异常处理
hibernate 根据方言生成sql
Memcached foundation 1
Oracle/PLSQL: Lpad Function
NOKOV动作捕捉系统使多场协同无人机自主建造成为可能
Systematic analysis of social networks using Networkx: Facebook network analysis case
宁愿去996也不要待业在家啦!24岁,失业7个月,比上班更惨的,是没班可上
两个页面之间传参方法
【系统分析师之路】第六章 复盘需求工程(案例论文)
Oracle/PLSQL: Substr Function
Memcached foundations 12
perl语言中 fork()、exec()、waitpid() 、 $? >> 8 组合
UVM中uvm_config_db非直线的设置与获取
学习DiscoDiffusion的最基础操作
markdown表格(合并)
XSS notes (Part 2)
Oracle/PLSQL: CharToRowid Function
速看!2022年6月编程语言排行榜出炉!第一名太牛啦
“所有专业都在劝退”,对大学生最友好的竟然是它?