当前位置:网站首页>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' |
边栏推荐
- Bs-gx-016 implementation of textbook management system based on SSM
- Oracle/PLSQL: Soundex Function
- Oracle/PLSQL: NumToDSInterval Function
- Oracle/PLSQL: Length Function
- Memcached basics 13
- getReader() has already been called for this request
- Why divide the training set and the test set before normalization?
- Analysis of ideal L9 product power: the price is 459800 yuan, the four cylinder engine is adopted, and the endurance is 1315km
- 简单学习GoogleColab的入门级概念
- 两个页面之间传参方法
猜你喜欢

SystemVerilog仿真速率提升

1.44寸TFT-LCD显示屏取模教程

Tsinghua & Zhiyuan | cogview2: faster and better text image generation model

速看!2022年6月编程语言排行榜出炉!第一名太牛啦

Modeling specifications: environment settings

按键控制LED状态翻转

C语言--职工信息管理系统设计

福元医药上市在即:募资净额将达到16亿元,胡柏藩为实际控制人

1.44 inch TFT-LCD display screen mold taking tutorial

George Washington University: Hanhan Zhou | PAC: auxiliary value factor decomposition with counterfactual prediction in Multi-Agent Reinforcement Learning
随机推荐
Oracle/PLSQL: Lpad Function
Cookie, sessionstorage, localstorage differences
架构实战营模块五作业
Tsinghua & Zhiyuan | cogview2: faster and better text image generation model
SQLite Reader 插件测试SQLite语法
Break through the performance bottleneck of image recognition through rust language computing acceleration technology
memcached基礎12
I encountered some problems when connecting to the database. How can I solve them?
Recursion will make strtok more attractive
markdown表格(合并)
接口隔离原则
Structure the fifth operation of the actual camp module
Analysis of ideal L9 product power: the price is 459800 yuan, the four cylinder engine is adopted, and the endurance is 1315km
Reporting Classes中uvm_report_server的get_severity_count和get_server用法
1.44 inch TFT-LCD display screen mold taking tutorial
Oracle/PLSQL: From_Tz function
持续交付-Blue Ocean 应用
Some exception handling for idea plug-in development
memcached基础13
memcached基础10