在Oracle中,SUBSTR函数用于提取字符串的子串。其语法如下:
SUBSTR(string, start_position, length)
string是要提取子串的字符串。start_position是子串的起始位置,从1开始计数。length是要提取的子串的长度。如果不指定length,则会返回从start_position到字符串末尾的所有字符。例如,假设我们有一个字符串'Hello World',我们想要提取World这个子串,可以这样写:
SELECT SUBSTR('Hello World', 7) FROM dual;
这将返回World。
辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读: oracle如何防止sql注入