有表T 有如下字段 id ,name,col1,col2,col3,col4 主键为id ,col1,col2,col3,col4 均可为空,只要col1,col2,col3,col4这四个字段中有一个包含关键字 key,就保留在数据库中,不满足这样的条件就删除
我这样写的 
delete from T where col1 not like '%key%' and col2 not like '%key%' and col3 not like '%key%'  and col4 not like '%key%' 
这样写在col1...col4 均不为null 时可以得到想要的结果,可是只要有一列为null 
就无法取得想要的结果
delete from T where( col1 not like '%key%' or col is null) and (col2 not like '%key%' or col2 is null) and( col3 not like '%key%'  or col3 is null) and ( col4 not like '%key%'  or col4 is null)
这样可以取得想要的记录
我不明白为什么在列为null时怎么无法删除记录,那位大侠出手相救,btw,我的sql写的有没有问题,若错误,请指证!!!