如果很多很多,建议建一个TB2表,COL字段,把内容装进去. 然后select tb1.* from tb1 where charindex(tb2.col,tb1.col) = 0
[code=SQL]select count(*) from tb where col not like '%ds%' and col not like '%fd%' and col not like '%89%' /code]
select count(*) from tb where col not like '%ds%' and col not like '%fd%' and col not like '%89%'
建表不大可能,其实可不是很多,估计不到15个吧。就是把个人blog给排除。我想用weibo blog 这样字样的给排除即可。欢迎提供有价值的方案。
如果是同时查询不存在这些内容. 貌似只能用and来做了. select t.* from tb1 where charindex('ds',tb1.col) = 0 and charindex('fd',tb1.col) = 0 and ...
你将很多很多的作为一个临时表,然后用not in或not exists等去处理。
在来源网址中把个人blog给排除。
如果只有15个,那就用and连接. select * from tb1 where charindex('ds',col) = 0 and charindex('fd',col) = 0 and ... 或者是like select * from tb1 where col not like '%ds%' and col not like '%fd%' and ...
然后select tb1.* from tb1 where charindex(tb2.col,tb1.col) = 0
貌似只能用and来做了.
select t.* from tb1 where charindex('ds',tb1.col) = 0 and charindex('fd',tb1.col) = 0 and ...
select * from tb1 where charindex('ds',col) = 0 and charindex('fd',col) = 0 and ...
或者是like
select * from tb1 where col not like '%ds%' and col not like '%fd%' and ...