1. A表 数据如下, 怎样替换 括号里面的数据 括号里的数据都是相同的
name
asafwfgewrg(aa)
sargvedrgbretgb(aa)
ergewgrweb(aa)
ergewgwegwew(aa)
weqwefwrg(aa)
2.1. A表 数据如下, 怎样替换 括号里面的数据 括号里的数据是不相同的
name
asafwfgewrg(wqwyusr)
sargvedrgbretgb(awereuee)
ergewgrweb(ewraeraer)
ergewgwegwew(uilutyiki)
weqwefwrg(yuiluylii)
------解决方案--------------------
括号里面一样的也可以
with t as(
select 'asafwfgewrg(aa)' as name from dual union all
select 'sargvedrgbretgb(aa)' as name from dual union all
select 'ergewgrweb(aa)' as name from dual union all
select 'ergewgwegwew(aa)' as name from dual union all
select 'weqwefwrg(aa)' as name from dual
)
select REGEXP_REPLACE(t.NAME,'\((.)+\)','(RESULT)') FROM t;