select * from tabel1 where store_name like '%北%' or store_name like '%上海%' .....
select * from tabel1 where store_name like '%北京%' or store_name like ... --看来和#1一样
select * from tabel1 where store_name in ('V北京农村合作社','V上海农村除污社','V上海农村环保社','V上海农村烧烤真的不好吃社','L厦门农村打假社')select * from tabel1 a1 where exists( select top 1 * from 合作社表 a2 where a1.store_name like '%'+substring(a2.name,2,2)+'%' ) --substring(a2.name,2,2)取某某社的第二第三个字,如'V北京农村合作社',就取‘北京’
select * from tabel1 a1 where exists( select top 1 * from 合作社表 a2 where a1.store_name like '%'+substring(a2.name,2,2)+'%' )
where store_name like '%北%'
or store_name like '%上海%'
.....
select * from tabel1 where store_name like '%北京%' or store_name like ...
--看来和#1一样
select * from tabel1 where store_name in ('V北京农村合作社','V上海农村除污社','V上海农村环保社','V上海农村烧烤真的不好吃社','L厦门农村打假社')select * from tabel1 a1 where exists(
select top 1 * from 合作社表 a2
where a1.store_name like '%'+substring(a2.name,2,2)+'%'
)
--substring(a2.name,2,2)取某某社的第二第三个字,如'V北京农村合作社',就取‘北京’
select * from tabel1 a1 where exists(
select top 1 * from 合作社表 a2
where a1.store_name like '%'+substring(a2.name,2,2)+'%'
)