select * from tb where charindex(col,'ABC')>0 ---这个意思?
我说的 A B C 分别代表字符串,ABC也是字符串,一般我们进行模糊查询,是查 一个字符串是数据库表中一个字段内容的子集,现在我需要反过来查询,数据库某一字段的内容是 一个字符串的子集
这得看你是查一长表中的呢还是查多张表的。得看具体情况来说,感觉你说的不太清楚。 用这种方式再加些条件,你试试。 select tb1 from table1 where tb1 in (select tb2 from table1 where tb2 like 'a%' and tb2 like 'b%' and tb2 like 'c%')
---这个意思?
用这种方式再加些条件,你试试。
select tb1 from table1
where tb1 in (select tb2 from table1 where tb2 like 'a%' and tb2 like 'b%' and tb2 like 'c%')