我想从oracle中的特定字符获取字符串的右侧部分。 [英] I want to get right hand side part of a string from a specific character in 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 [Quote:如果省略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屋!