SQL Select everything after character

前端 未结 6 723
半阙折子戏
半阙折子戏 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:55

    SQL Server Management Studio v15.0.18206.0 (18.4):

    RIGHT([col], CHARINDEX('-', REVERSE([col]), -1))

提交回复
热议问题