查找字段content中包含字符串str的行Declare @str varchar(20)
set @str = '1.2,1.3,1.4'
SELECT [pro_id]
,[protype]
,[content]
,[diff]
,[chapter]
,[score]
FROM [exam].[dbo].[shitiInfo]
where content like '%"+ @str +"%'
set @str = '1.2,1.3,1.4'
SELECT [pro_id]
,[protype]
,[content]
,[diff]
,[chapter]
,[score]
FROM [exam].[dbo].[shitiInfo]
where content like '%"+ @str +"%'
,[protype]
,[content]
,[diff]
,[chapter]
,[score]
FROM [exam].[dbo].[shitiInfo]
where cast(content as varchar) like '%1.[2-4]%'
,[protype]
,[content]
,[diff]
,[chapter]
,[score]
FROM [exam].[dbo].[shitiInfo]
where charindex(@str,content)>0
,[protype]
,[content]
,[diff]
,[chapter]
,[score]
FROM [exam].[dbo].[shitiInfo]
where charindex(','+@str+',',','+content+',')>0