How to remove part of the string in oracle

前端 未结 3 1735
猫巷女王i
猫巷女王i 2021-01-04 21:51

Input data:

abcdef_fhj_viji.dvc

Expected output:

fhj_viji.dvc

The part to be trimmed is not constant.

3条回答
  •  自闭症患者
    2021-01-04 22:22

    select substr('abcdef_fhj_viji.dvc',instr('abcdef_fhj_viji.dvc','_')+1) from dual
    

    So, Its all depends on INSTR function, define from which position and which occurrence, you will get the index and pass that index to SUBSTR to get your string.

提交回复
热议问题