我想从oracle中的特定字符获取字符串的右侧部分。 [英] I want to get right hand side part of a string from a specific character in oracle.

查看:415
本文介绍了我想从oracle中的特定字符获取字符串的右侧部分。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从特定字符获取字符串的右侧部分,但字符串长度在角色的两侧都是动态的。可以使用以下查询获得左侧。不能是右侧。任何人帮助我。

例如:

leftside [右侧]



SELECT SUBSTR('leftside [rightside] ]',0,INSTR('leftside [rightside]','[',1)-1)来自双人





i需要用这个角色来右转。

解决方案

你的查询中看起来有一些拼写错误。



更改自

  SELECT  SUBSTR('  leftside [rightside]' 0 ,INSTR( '  leftside [rightside]''  [' 1 ) -  1)





  SELECT  SUBSTR('  leftside [rightside]' 1 ,INSTR('  leftside [rightside]''  [' 1 )) FROM  dual 





请参阅 Oracle:SUBSTR [

如果省略substring_length,则Oracle将所有字符返回到char的末尾。如果substring_length小于1,则Oracle返回null。


I want to get right hand side part of a string from a specific character but the string length is dynamic from both side of the character. Can get left side using following query.Can't the right side. Any one help me.
Example:
leftside[rightside]

SELECT SUBSTR('leftside[rightside]',0,INSTR('leftside[rightside]','[',1)-1) From dual


i need to get right side with that character.

Looks like you have a few typos in your query.

Change from

SELECT SUBSTR('leftside[rightside]', 0, INSTR('leftside[rightside]', '[', 1)-1) From dual


to

SELECT SUBSTR('leftside[rightside]', 1, INSTR('leftside[rightside]', '[', 1)) FROM dual



See
Oracle: SUBSTR[^]

Quote:

If substring_length is omitted, then Oracle returns all characters to the end of char. If substring_length is less than 1, then Oracle returns null.


这篇关于我想从oracle中的特定字符获取字符串的右侧部分。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆