SQL Select everything after character

前端 未结 6 816
半阙折子戏
半阙折子戏 2021-02-07 07:18

I\'d like to select everything AFTER a certain character (-) that is placed on the most right side.

Eg.

abcd-efgh-XXXX

And I\'d like t

6条回答
  •  南旧
    南旧 (楼主)
    2021-02-07 07:29

    You can use:

    select right(col, charindex('-', reverse(col)) - 1)
    

提交回复
热议问题