34,874
社区成员
发帖
与我相关
我的任务
分享declare @name varchar(100)
set @name = 'd'
select top 1 *
from table
where charindex(','+@name+',',','+agroup+','+bgroup+','+cgroup + ',') > 0
order by iddeclare @name varchar(100)
set @name = 'd'
select top 1 *
from table
where charindex(',+@name+,',','+agroup+','+bgroup+','+cgroup + ',') > 0
order by idselect top 1 *
from table
where charindex(',d,',','+agroup+','+bgroup+','+cgroup + ',') > 0
order by id--其中一个包含.
select top 1 * from tb where charindex(','+@session+',' , ','+agroup+',') > 0 or
charindex(','+@session+',' , ','+bgroup+',') > 0 or
charindex(','+@session+',' , ','+cgroup+',') > 0
--三个都包含
select top 1 * from tb where charindex(','+@session+',' , ','+agroup+',') > 0 and
charindex(','+@session+',' , ','+bgroup+',') > 0 and
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 idselect top 1 * from tb where charindex(','+@session+',' , ','+agroup+',') > 0 or
charindex(','+@session+',' , ','+bgroup+',') > 0 or
charindex(','+@session+',' , ','+cgroup+',') > 0