oracle 12c - select string after last occurrence of a character

前端 未结 5 1781
旧时难觅i
旧时难觅i 2020-12-11 02:27

I have below string:

ThisSentence.ShouldBe.SplitAfterLastPeriod.Sentence

So I want to select Sentence since it is the string a

5条回答
  •  醉酒成梦
    2020-12-11 03:04

    how many dots in a string?

    select length(str) - length(replace(str, '.', '') number_of_dots from ...
    

    get substring after last dot:

    select substr(str, instr(str, '.', 1, number_of_dots)+1) from ...
    

提交回复
热议问题