How can I add a character into a specified position into string in SQL SERVER?

前端 未结 9 2392
傲寒
傲寒 2021-02-19 07:48

I have a varchar field like:

195500
122222200

I need to change these values to:

1955.00
1222222.00
9条回答
  •  再見小時候
    2021-02-19 08:10

    try this

    Declare @s varchar(50) = '1234567812333445'
    Select Stuff(@s, Len(@s)-1, 0, '.')
    --> 12345678123334.45
    

    fiddle demo

提交回复
热议问题