欢迎投稿

今日深度:

Oracle技术_字符串处理_截取文件名或扩展名

Oracle技术_字符串处理_截取文件名或扩展名


截取文件名:

SELECT SUBSTR('pop.kid.orc.txt', 1, INSTR('pop.kid.orc.txt', '.', -1) - 1) AS FILE_NAME
  FROM DUAL;
截取扩展名:
SELECT SUBSTR('pop.kid.orc.txt',
              INSTR('pop.kid.orc.txt', '.', -1) + 1,
              LENGTH('pop.kid.orc.txt')) AS FILE_NAME
  FROM DUAL;

www.htsjk.Com true http://www.htsjk.com/oracle/22746.html NewsArticle Oracle技术_字符串处理_截取文件名或扩展名 截取文件名: SELECT SUBSTR(pop.kid.orc.txt, 1, INSTR(pop.kid.orc.txt, ., -1) - 1) AS FILE_NAME FROM DUAL; 截取扩展名: SELECT SUBSTR(pop.kid.orc.txt, INSTR(pop.kid.orc.txt...
评论暂时关闭