Given Letter, Get Next Letter in Alphabet

后端 未结 5 505
天涯浪人
天涯浪人 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:59

    This is how you'd do it for one letter

    DECLARE @myletter char(1) = 'a';
    SELECT CHAR(ASCII(@myletter)+1);
    

提交回复
热议问题