我在Oracle 11g数据库中有一个表,其中包含一个名为REPORT的列。我正在尝试编写一个select语句,它将在下面显示所需的结果。我需要选择“\”和下一个“#”之间的字符串。我认为这可以使用regexp_substr函数来完成,但我没有取得任何成功。我有太多关于上周在这里发布的不成功尝试的例子。任何帮助将不胜感激。
REPORT_COLUMN
#Med Reports\Client, Ray.dco#
Financial Reports\Client, Justin-1.dco#Financial Reports/Client, Justin-1.dco#
#Med Reports\Client, Jessy.dco#
Financial Reports\Client, Channa-1.dco#Financial Reports/Client, Charnisha-1.dco#
所需结果:
Client, Ray.dco
Client, Justin-1.dco
Client, Jessy.dco
Client, Channa-1.dco
答案 0 :(得分:0)
select regexp_substr(REPORT_COLUMN,'\\(.*?)#',1,1,'',1)
from Table