How to remove part of the string in oracle

前端 未结 3 1712
猫巷女王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:05

    Use the REPLACE method

    Select REPLACE('abcdef_fhj_viji.dvc','abcde','')
    

    If you want this query for your table :

    Select REPLACE(column,'abcde','') from myTable
    

    For update :

    UPDATE TABLE
       SET column = REPLACE(column,'abcde','') 
    

提交回复
热议问题