select * from table where content like '%abc%'
and id
not in (select * from table where charindex('abc',content)>0)----------------------------------------------------------------这个 SQL 语句本身就不对
and id
not in (select * from table where charindex('abc',content)>0)----------------------------------------------------------------这个 SQL 语句本身就不对
and id
not in (select id from table where charindex('abc',content)>0)
*
from
table
where
content like '%abc%'
and
id not in (select
id
from
table
where
charindex('abc',content)>0)
谢谢。那为什么得到的结果集不同呢?
content是ntext字段,有关系吗?
*
from
table
where
content like '%abc%'
and
id not in (select
id
from
table
where
charindex('abc',content)>=0)