How to split string using delimiter char using T-SQL?

后端 未结 4 1320
无人及你
无人及你 2020-11-30 11:48

I have this long string in one of the columns of the table. I want to get only specific information:- My Table structure:-

Col1 = \'123\'
Col2 = \'AAAAA\'
Co         


        
4条回答
  •  遥遥无期
    2020-11-30 12:38

    You simply need to do a SUBSTR on the string in col3....

        Select col1, col2, REPLACE(substr(col3, instr(col3, 'Client Name'), 
        (instr(col3, '|', instr(col3, 'Client Name')  -
        instr(col3, 'Client Name'))
        ),
    'Client Name = ',
    '')
        from Table01 
    

    And yes, that is a bad DB design for the reasons stated in the original issue

提交回复
热议问题