--测试数据 create table #t (name varchar (80))insert into #t select '青菜|萝卜|猪肉' union all select '萝卜' union all select '青菜' union all select '萝卜|猪肉' union all select '白菜|猪肉'--测试select select * from #t where charindex(#t.name,'青菜|萝卜|猪肉')>0 or charindex('青菜|萝卜|猪肉',#t.name) > 0 --删表 drop table #t
create table #t (name varchar (80))insert into #t
select '青菜|萝卜|猪肉' union all
select '萝卜' union all
select '青菜' union all
select '萝卜|猪肉' union all
select '白菜|猪肉'--测试select
select * from #t
where
charindex(#t.name,'青菜|萝卜|猪肉')>0
or charindex('青菜|萝卜|猪肉',#t.name) > 0 --删表
drop table #t