oracle中substr的有哪些作用
在Oracle中,SUBSTR函数用于获得一个字符串的子字符串。它的作用是从一个字符串中截取指定长度的子字符串。
SUBSTR函数通常使用以下语法:
SUBSTR(string, start_position, length)
其中:
以下是一些示例:
SUBSTR('Hello, World!', 8, 5) 返回 'World',由于它从第8个字符开始截取长度为5的子字符串。
SUBSTR('Hello, World!', ⑹) 返回 'World!',由于它从倒数第6个字符开始截取到字符串的末尾。
SUBSTR('Hello, World!', 8, ⑴) 返回 'World',由于它从第8个字符开始截取到倒数第一个字符之前。
TOP