Home > Database > Mysql Tutorial > body text

Oracle 取规定位置的子串

WBOY
Release: 2016-06-07 17:08:38
Original
1183 people have browsed it

例如:数据格式为:substring-substring-substring --取子串 SELECT SUBSTR(源字符串或字段名,INSTR(源字符串或字段名,

例如:数据格式为:substring-substring-substring

--取子串

SELECT SUBSTR(源字符串或字段名,INSTR(源字符串或字段名,'-')+1,INSTR(源字符串或字段名'-',1,2)-INSTR(源字符串或字段名,'-')-1) from  表名;

--解释

--用到substr()函数和instr()函数

--substr(源字符串或字段,,起始位置,子串的长度)

--instr(源字符串或字段,要取的子串,起始位置,要取子串的出现次数)

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template