有张表 arc_potent,输入如下SQL:
insert into arc_potent (id,potenttype,user_id) values (12000,1,1);
insert into arc_potent (id,potenttype,user_id) values (12000,2,1);
结果是:
12000 1 1
12000 2 1已经有了以上结果后,再输入以下语句:
delete from arc_potent where id=12000;
insert into arc_potent (id,potenttype,user_id) values (12000,1,1);
insert into arc_potent (id,potenttype,user_id) values (12000,2,1);
结果是:
12000 2 1
12000 1 1想问问,第二段SQL应该怎么写,才能让结果2和结果1一样.

解决方案 »

  1.   

    insert into arc_potent (id,potenttype,user_id) values (12000,1,1),(12000,2,1); 
      

  2.   

    delete   from   arc_potent   where   id=12000; 
    insert   into   arc_potent   (id,potenttype,user_id)   values   (12000,1,1),(12000,2,1);   结果还是:
    12000 2 1 
    12000 1 1 
      

  3.   

    select * from ar_potent order by potenttype asc;
      

  4.   

    那就看一下你配置文件中的SQL_MODE是什么? select @@sql_mode;