34,590
社区成员
发帖
与我相关
我的任务
分享
"select * from table1 where charindex(name," & names & ")>0"
"select * from table1 where charindex(name," & names & ")>0"
declare @s varchar(8000)
set @s='张三,李四,赵六'
set @s=''''+replace(@s,',',''',''')+''''
select @s
/*
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'张三','李四','赵六'
(所影响的行数为 1 行)
*/
--try:
string[] names = new string[3]{"张三","李四","赵六"};
string strSQL = "select * from table1 where where charindex(','+name+',', ','+names+',')>0";