Remove the last character in a string in T-SQL?

前端 未结 21 2381
不思量自难忘°
不思量自难忘° 2020-12-07 09:22

How do I remove the last character in a string in T-SQL?

For example:

\'TEST STRING\'

to return:

\'TES         


        
21条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-07 09:57

    Try this:

    select substring('test string', 1, (len('test string') - 1))
    

提交回复
热议问题