当运行delete语句的时候,返回已经删除了0行。那就表示根本没有达到预期的目的,各位高手,该怎么办呢?

解决方案 »

  1.   

    delete from tablename where column1 is null and column2 is null;
      

  2.   

    假如table为 (name,age)
    按问题中的方法插入后,可以光根据根据name的值来进行类似操作吗?
      

  3.   

    delete from tablename where name is null
      

  4.   

    两个条件比较可靠了,如果你只插入一条,那应该没问题了,根据name值是把所有name为null的记录删除掉了
      

  5.   

    to:wxyq2000(wxyq) ;trampwind(随风)
    **********返回结果:删除了0行*********
    你们可以试试看
      

  6.   

    不会吧,你的SQL语句?我是试过了可以的
      

  7.   

    insert into nulltest(name,sex) values (null,null);
    delete from nulltest where name=null and sex=null;
    结果:Query OK,0 rows affected
      

  8.   

    你的SQL不对啊,不是上面写了么,不能用=,应该是 
    delete from nulltest where name is null and sex is null;
      

  9.   

    一般不用=null的,null是个关键字,用它的时候都是用 is null 或 is not null,至少我没过=null的
    如果你这样插入:insert into nulltest(name,sex) values ('null','null');
    那么你删除的时候就应该:
    delete from nulltest where name='null' and sex='null';