Comma Delimited SQL string Need to separated

前端 未结 11 1985
[愿得一人]
[愿得一人] 2020-12-20 23:39

I have this string that i am getting from .net application A,B,C,D,E,F,

I wanted to write a sql select statement like

set @string = \'A,B,C,D,E,F\'

         


        
11条回答
  •  不知归路
    2020-12-21 00:14

    3 options

    1. Use a regular expression to replace the "," with "','" so that it becomes a proper ('A','B'...) list
    2. Convert the list to XML and then parse the XML in your SELECT
    3. Write a SPLIT function to convert comma delimited lists to tables

提交回复
热议问题