日期:2014-05-18 浏览次数:20513 次
select top 1 * from tb where charindex(','+@session+',' , ','+agroup+',') > 0 or charindex(','+@session+',' , ','+bgroup+',') > 0 or charindex(','+@session+',' , ','+cgroup+',') > 0
------解决方案--------------------
select top 1 * from table where charindex(',d,',','+agroup+',') > 0 or charindex(',d,',','+bgroup+',') > 0 or charindex(',d,',','+cgroup+',') > 0 order by id
------解决方案--------------------
+@session
因为四楼的写法是变量赋值的
你前面加个
set @session=''d''