现在用sql语句查出来字段里包含某个字符串的所有记录怎么查

如题所述

select * from table where instr(col1,str2)<>0
oracle是instr 返回str2在str1的起始位置,如果没有就返回0
不知道你是什么数据库,如果实现不行就
select * from table where col1 not like '%str2%'
温馨提示:答案为网友推荐,仅供参考