我希望在oracle查询中使用dots
的电子邮件中替换 @
之前的所有empty string
喜欢:
anurag.mart@hotmail.com >> anuragmart@hotmail.com
答案 0 :(得分:3)
最简单的方法是使用 REGEXP_REPLACE 来识别模式并将其替换为所需的模式。
<script src="http://tjcrowder.github.io/simple-snippets-console/snippet.js"></script>
例如,
regexp_replace('anurag.mart@hotmail.com', '(\w+)\.(\w+)(@+)', '\1\2\3')
答案 1 :(得分:2)
@
)1
)和结束(@
)位置之间提取数据.
替换为''
试试这个
SELECT Replace(Substr('anurag.mart@hotmail.com', 1,
Instr('anurag.mart@hotmail.com', '@', 1)), '.', '')
|| Substr('anurag.mart@hotmail.com', Instr('anurag.mart@hotmail.com','@')+1)
FROM dual
<强>结果:强>
anuragmart@hotmail.com