Given Letter, Get Next Letter in Alphabet

后端 未结 5 498
天涯浪人
天涯浪人 2021-01-17 19:18

I have letter \"a\", \"b\", \"c\". I would like my results to be \"b\", \"c\", \"d\" in TSQL respectively. Would what I use to achieve this?

5条回答
  •  伪装坚强ぢ
    2021-01-17 19:55

    Use ASCII to get the value of the character, add one, and use CHAR to convert the value back to a character.

    SELECT CHAR(ASCII('a') + 1)
    

提交回复
热议问题