T-SQL Split Word into characters

前端 未结 5 1191
太阳男子
太阳男子 2020-11-28 12:19

I have searched everywhere and I cannot find this implementation anywhere.

Let\'s say I have the word: QWERTY

I want to obtain this table:

5条回答
  •  萌比男神i
    2020-11-28 12:45

    Declare @word nvarchar(max)
    Select @word = 'Hello This is the test';
    
    with cte (Number)as 
    (Select 1
    union all 
    select Number +1 From cte  where number 

提交回复
热议问题