在修改以下查询时寻求帮助,
select distinct
upper(
regexp_replace(
regexp_substr(asset,'@([^\.-]+)[so]?[\.-]',1,1,'i',1)
,'[so]$','')
) AS instancename,
Asset
from hsbc_csmip_dbprotect
Asset |Instancename
----------------------------------------+------------
EMS | NULL
IGASDBL_11G | NULL
IGASHLEL_11G | NULL
LMSPEGA1@SSUML527 | NULL
ABACOGP@abacogp@ora-abacogp.de.hsbc |ABACOGP@ORA
ABM00@frlooraprda1.systems.uk.hsbc |FRLOORAPRDA1
ABMHIST@trabmora01h.hbtr.adroot.hsbc |TRABMORA01H
Asset |Instancename
----------------------------------------+------------
EMS |EMS
IGASDBL_11G |IGASDBL
IGASHLEL_11G |IGASHLEL
LMSPEGA1@SSUML527 |SSUML527
ABACOGP@abacogp@ora-abacogp.de.hsbc |ABACOGP
ABM00@frlooraprda1.systems.uk.hsbc |FRLOORAPRDA1
ABMHIST@trabmora01h.hbtr.adroot.hsbc |TRABMORA01H
答案 0 :(得分:0)
检查是否有效:
select distinct upper(regexp_substr(SUBSTR(asset, INSTR(asset, '@')+1),'[^-@\.]+',1,1)) AS instancename,Asset
from hsbc_csmip_dbprotect;